Skip to content

Commit

Permalink
fix: button styles (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking authored Oct 19, 2024
1 parent 831bb16 commit 5019809
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Button = (props: ButtonProps, ref: FocusableRef<HTMLButtonElement>) => {
onClick,
icon,
className,
size = 'normal',
size = 'default',
...otherProps
} = props;
const isDisabled = disabled || loading;
Expand Down
4 changes: 2 additions & 2 deletions src/button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export const buttonCSS = css`
cursor: default;
opacity: ${theme.opacity.disabled};
}
&[data-size='normal'][data-childless='false'] {
&[data-size='default'][data-childless='false'] {
padding: var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-200);
}
&[data-size='compact'][data-childless='false'] {
padding: var(--ac-global-dimension-static-size-50)
var(--ac-global-dimension-static-size-100);
}
&[data-size='normal'][data-childless='true'] {
&[data-size='default'][data-childless='true'] {
padding: var(--ac-global-dimension-static-size-100)
var(--ac-global-dimension-static-size-100);
}
Expand Down
22 changes: 12 additions & 10 deletions src/utils/styleProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,21 +315,23 @@ export function useStyleProps<T extends StyleProps>(
// @ts-ignore
if (otherProps.className) {
// eslint-disable-next-line no-console
console.warn(
'The className prop is unsafe and is unsupported in Arize Components. ' +
'Please use style props with AC variables, or UNSAFE_className if you absolutely must do something custom. ' +
'Note that this may break in future versions due to DOM structure changes.'
);
// TODO: add back this warning when we have a better solution for className
// console.warn(
// 'The className prop is unsafe and is unsupported in Arize Components. ' +
// 'Please use style props with AC variables, or UNSAFE_className if you absolutely must do something custom. ' +
// 'Note that this may break in future versions due to DOM structure changes.'
// );
}

// @ts-ignore
if (otherProps.style) {
// eslint-disable-next-line no-console
console.warn(
'The style prop is unsafe and is unsupported in React Arize Components. ' +
'Please use style props with AC variables, or UNSAFE_style if you absolutely must do something custom. ' +
'Note that this may break in future versions due to DOM structure changes.'
);
// TODO: add back this warning when we have a better solution for className
// console.warn(
// 'The style prop is unsafe and is unsupported in React Arize Components. ' +
// 'Please use style props with AC variables, or UNSAFE_style if you absolutely must do something custom. ' +
// 'Note that this may break in future versions due to DOM structure changes.'
// );
}

const styleProps: HTMLAttributes<HTMLElement> = {
Expand Down

0 comments on commit 5019809

Please sign in to comment.