File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,19 +3,25 @@ import {
33 Button as ButtonPrimitive ,
44 type ButtonProps as ButtonPrimitiveProps
55} from 'react-aria-components'
6-
76import './Button.css'
7+ import type { ComponentType , ReactNode } from 'react'
8+ import { Icon } from './Icon.tsx'
9+ import { ProgressCircle } from './ProgressCircle.tsx'
810
911export interface ButtonProps extends ButtonPrimitiveProps {
1012 appearance ?: 'solid' | 'outline' | 'plain' | 'active'
1113 intent ?: 'primary' | 'secondary' | 'danger' | 'warning'
1214 size ?: 'small' | 'medium' | 'large' | 'square-petite' | 'icon'
15+ icon ?: ComponentType
16+ children ?: ReactNode
1317}
1418
1519export function Button ( {
1620 intent = 'primary' ,
1721 size = 'medium' ,
1822 appearance = 'solid' ,
23+ children,
24+ icon,
1925 ...props
2026} : ButtonProps ) {
2127 return (
@@ -25,6 +31,13 @@ export function Button({
2531 data-appearance = { appearance }
2632 { ...props }
2733 className = { clsx ( 'alinea-rac-Button' , props . className ) }
28- />
34+ >
35+ { props . isPending ? (
36+ < ProgressCircle isIndeterminate aria-label = "Pending..." />
37+ ) : (
38+ icon && < Icon icon = { icon } data-slot = "icon" />
39+ ) }
40+ { children }
41+ </ ButtonPrimitive >
2942 )
3043}
You can’t perform that action at this time.
0 commit comments