File tree Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 11import React , { ReactNode , useState } from "react" ;
22import AccordionItem from "./accordion-item" ;
3- import { cn } from "../../utils" ;
3+ import { cn , isUndefined } from "../../utils" ;
44
55interface AccordionItem {
66 title : ReactNode ;
@@ -10,14 +10,18 @@ interface AccordionItem {
1010interface AccordionProps {
1111 items : AccordionItem [ ] ;
1212 className ?: string ;
13+ defaultExpanded ?: number ;
1314}
1415
1516const CustomAccordion : React . FC < AccordionProps > = ( {
1617 items,
1718 className,
19+ defaultExpanded,
1820 ...props
1921} ) => {
20- const [ expanded , setExpanded ] = useState ( - 1 ) ;
22+ const [ expanded , setExpanded ] = useState (
23+ ! isUndefined ( defaultExpanded ) ? defaultExpanded : - 1 ,
24+ ) ;
2125 return (
2226 < div
2327 className = { cn ( "box-border flex w-[1000px] flex-col" , className ) }
Original file line number Diff line number Diff line change 11import React , { ReactNode , useState } from "react" ;
22import AccordionItem from "./accordion-item" ;
3- import { cn } from "../../utils" ;
3+ import { cn , isUndefined } from "../../utils" ;
44
55interface AccordionItem {
66 title : string ;
@@ -28,7 +28,9 @@ const Accordion: React.FC<AccordionProps> = ({
2828 className,
2929 ...props
3030} ) => {
31- const [ expanded , setExpanded ] = useState ( defaultExpanded ?? - 1 ) ;
31+ const [ expanded , setExpanded ] = useState (
32+ ! isUndefined ( defaultExpanded ) ? defaultExpanded : - 1 ,
33+ ) ;
3234 return (
3335 < div
3436 className = { cn ( "box-border flex w-[1000px] flex-col" , className ) }
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ interface BigNumberFieldComponentProps extends BigNumberFieldProps {
1515 message ?: string ;
1616 Icon ?: React . FC < React . SVGAttributes < SVGElement > > ;
1717 className ?: string ;
18+ /** The name of the input element, used when submitting an HTML form.*/
19+ name ?: string ;
1820}
1921
2022/** A number field that handles big numbers.
@@ -29,6 +31,7 @@ function BigNumberField({
2931 isDisabled,
3032 id : propId ,
3133 isReadOnly,
34+ name,
3235 ...props
3336} : Readonly < BigNumberFieldComponentProps > ) {
3437 // Generate an ID if one is not provided
@@ -65,6 +68,7 @@ function BigNumberField({
6568 < >
6669 < Input
6770 { ...inputProps }
71+ name = { name }
6872 className = { cn (
6973 "hover-short-transition bg-klerosUIComponentsWhiteBackground size-full" ,
7074 "rounded-base border-klerosUIComponentsStroke text-klerosUIComponentsPrimaryText border text-base" ,
Original file line number Diff line number Diff line change @@ -566,7 +566,6 @@ export function useBigNumberField(props: BigNumberFieldProps) {
566566 type : "button" as const ,
567567 "aria-label" : "Increment" ,
568568 "aria-controls" : id ,
569- slot : "increment" ,
570569 isDisabled : ! canIncrement ( ) ,
571570 onPress : increment ,
572571 } ) ;
@@ -576,7 +575,6 @@ export function useBigNumberField(props: BigNumberFieldProps) {
576575 type : "button" as const ,
577576 "aria-label" : "Decrement" ,
578577 "aria-controls" : id ,
579- slot : "decrement" ,
580578 isDisabled : ! canDecrement ( ) ,
581579 onPress : decrement ,
582580 } ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export { default as DisplaySmall } from "./display/small";
1515export { default as DropdownSelect } from "./dropdown/select" ;
1616export { default as DropdownCascader } from "./dropdown/cascader" ;
1717
18+ export { default as Form } from "./form/index" ;
1819export { default as NumberField } from "./form/number-field" ;
1920export { default as BigNumberField } from "./form/bignumber-field" ;
2021export { default as TextField } from "./form/text-field" ;
You can’t perform that action at this time.
0 commit comments