Rebuild TextField and CalendarField

This commit is contained in:
Ben Grant 2023-05-21 21:34:06 +10:00
parent 1e77205518
commit 12004b8584
28 changed files with 783 additions and 845 deletions

View file

@ -58,6 +58,16 @@
}
}
.iconButton {
height: 30px;
width: 30px;
padding: 0;
& svg, & img {
margin: 0;
}
}
.small {
padding: .4em 1.3em;
}

View file

@ -16,8 +16,6 @@ type ButtonProps = {
surfaceColor?: string
/** Override the shadow color of the button */
shadowColor?: string
// TODO: evaluate
size?: string
} & Omit<React.ComponentProps<'button'> & React.ComponentProps<'a'>, 'ref'>
const Button: React.FC<ButtonProps> = ({
@ -30,7 +28,6 @@ const Button: React.FC<ButtonProps> = ({
isLoading,
surfaceColor,
shadowColor,
size,
style,
...props
}) => {
@ -40,14 +37,14 @@ const Button: React.FC<ButtonProps> = ({
isSecondary && styles.secondary,
isSmall && styles.small,
isLoading && styles.loading,
!children && icon && styles.iconButton,
),
style: {
...surfaceColor && { '--override-surface-color': surfaceColor, '--override-text-color': '#FFFFFF' },
...shadowColor && { '--override-shadow-color': shadowColor },
...size && { padding: 0, height: size, width: size },
...style,
},
children: [icon, children],
children: <>{icon}{children}</>,
...props,
}