Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/dbeaver/vscode#86/storybook integration #3251

Open
wants to merge 43 commits into
base: devel
Choose a base branch
from

Conversation

SychevAndrey
Copy link
Contributor

No description provided.

@SychevAndrey SychevAndrey requested a review from Wroud February 10, 2025 09:37
@SychevAndrey SychevAndrey self-assigned this Feb 10, 2025
@SychevAndrey SychevAndrey force-pushed the feat/dbeaver/vscode#86/storybook-integration branch 2 times, most recently from aeaf44d to 60369a4 Compare February 12, 2025 11:12
@SychevAndrey SychevAndrey force-pushed the feat/dbeaver/vscode#86/storybook-integration branch from bbfb88d to 574f786 Compare February 12, 2025 13:59
@SychevAndrey SychevAndrey marked this pull request as ready for review February 13, 2025 08:52
Comment on lines 24 to 27
"@ariakit/react": "^0.4.15",
"@ladle/react": "^5.0.1",
"@tailwindcss/vite": "^4.0.3",
"@wroud/vite-plugin-asset-resolver": "^0.1.5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep only major version like ^5
also check for dependencies that it's added correctly to devDependencies and dependencies

}

export function Button({ className, variant = 'primary', size = 'medium', loading, children, onClick, ...props }: UiKitButtonProps) {
const classToApply = `dbv-ui-button dbv-ui-button--${variant} dbv-ui-button--${size}` + (className ? ` ${className}` : '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's better to use a prefix like dbv-kit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kit has less meaning for me than ui, plus ui is one symbol shorter means less html and css. So why should we change it? Can we vote in the team maybe?

}

export interface ButtonIconProps extends React.HTMLAttributes<HTMLSpanElement> {
position?: 'left' | 'right';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is composition element, doesn't position controlled by inserting component in the right position?:

<Button>
  some text
  <Button.Icon />
</Button>
<Button>
  <Button.Icon />
  some text
</Button>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you are basically not controlling the position with this props, but styles (subtract padding to balance the button). You may define the prop or keep it empty. It's not ideal, let's discuss

* you may not use this file except in compliance with the License.
*/

@layer components {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file name is incorrect (must be Button)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git didn't want to change it) Fixed.

Comment on lines 32 to 56
.dbv-ui-button--small {
padding-inline: calc(var(--btn-padding-inline) * 0.5);
padding-block: calc(var(--btn-padding-block) * 0.5);
font-size: calc(var(--btn-font-size) * 0.875);
height: var(--control-height-small);
}

.dbv-ui-button--medium {
height: var(--control-height-medium);
font-size: var(--btn-font-size);
}

.dbv-ui-button--large {
padding-inline: calc(var(--btn-padding-inline) * 1.25);
padding-block: calc(var(--btn-padding-block) * 1.25);
font-size: calc(var(--btn-font-size) * 1.125);
height: var(--control-height-large);
}

.dbv-ui-button--xlarge {
padding-inline: calc(var(--btn-padding-inline) * 1.5);
padding-block: calc(var(--btn-padding-block) * 1.5);
font-size: calc(var(--btn-font-size) * 1.25);
height: var(--control-height-xlarge);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we adjust css variable instead, like:

  .dbv-ui-button--large {
    --btn-padding-inline: calc(var(--btn-padding-inline) * 1.25);
    --btn-padding-block: calc(var(--btn-padding-block) * 1.25);
    --btn-font-size: calc(var(--btn-font-size) * 1.125);
    --btn-height: var(--control-height-large);
  }

(this code may not work as expected but shows an idea)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also may be good to use a global multiplier (so you need to change only one variable)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry didn't understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood, working on that

import { Button as AriaButton, type ButtonProps } from '@ariakit/react';
import './Button.css';

export interface UiKitButtonProps extends Omit<ButtonProps, 'clickOnEnter' | 'clickOnSpace'> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just ButtonProps

Comment on lines -27 to 29
height: 8px;
width: 8px;
height: 16px;
width: 16px;
align-self: flex-start;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange changes

height: 24px;
height: 32px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange changes

padding-left: 8px;
justify-content: center;
align-items: center;

& .staticImage,
& .iconOrImage,
& img {
max-width: 16px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange changes

@SychevAndrey SychevAndrey requested a review from Wroud February 14, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants