Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(theme): [tree,tooltip,transfer,cascader,input] update smb design for tree/tooltip/transfer/cascader components #1970

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

Merged
merged 8 commits into from
Aug 26, 2024

Conversation

shenjunjian
Copy link
Collaborator

@shenjunjian shenjunjian commented Aug 22, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

整改4个组件的检视问题
1、tree
2、tooltip
3、transfer
4、cascader

整改input的suffix 节点的top值

Summary by CodeRabbit

  • New Features

    • Enhanced tooltip appearance with increased vertical padding.
    • New TransferPanel component added for improved functionality.
    • Support for dynamic input types in the transfer panel.
    • Conditional highlighting of text based on user input in the Cascader component.
    • Added padding properties to tree components for improved layout.
    • New theming option for the Cascader component to customize dropdown appearance.
  • Bug Fixes

    • Removed deprecated properties in themes for cleaner styling.
  • Style

    • Updated CSS styles for various components to enhance visual consistency and usability.
    • Introduced new padding and margin settings for better layout in transfer and tree components.
  • Documentation

    • Updated package metadata to improve clarity and usability.
  • Chores

    • Reorganized dependencies and enhanced package structure for better maintenance.

Copy link

coderabbitai bot commented Aug 22, 2024

Walkthrough

The changes involve multiple modifications across various files, focusing on CSS style enhancements, updates to exported components, and the introduction of new configuration settings. Key updates include the addition of font size properties, adjustments to padding and margin, the introduction of new components, and the inclusion of directives aimed at improving the visual presentation and usability of several components.

Changes

Files Group Change Summary
examples/sites/demos/pc/app/tooltip/*.vue Added font-size: 16px to .red class in content-composition-api.vue and content.vue. No changes to exported entities.
packages/design/smb/*.ts Added TransferPanel to exports in index.ts. Introduced a new configuration object in transfer-panel/index.ts. Enhanced parameters in functions within vue.ts.
packages/theme/src/cascader-node/*.js Updated background color for disabled nodes and adjusted font size for icons in smb-theme.js. No changes to exported entities.
packages/theme/src/cascader/*.js Added ti-cascader-border-radius: 6px property in smb-theme.js.
packages/theme/src/input/*.less and *.js Modified suffix positioning properties in index.less, added new properties for input suffixes in smb-theme.js, and introduced new variables in vars.less.
packages/theme/src/select/*.js and *.less Removed icon positioning variables and properties related to select input icons in smb-theme.js and vars.less.
packages/theme/src/theme.config.js Updated theme configuration to add new cascader mapping and remove deprecated entries.
packages/theme/src/tooltip/smb-theme.js Increased vertical padding in tooltips from 9px to 12px.
packages/theme/src/transfer/*.less and *.js Enhanced styling rules for transfer components, updated padding and margin settings, and added new theme properties in smb-theme.js.
packages/theme/src/tree/*.less and *.js Added padding properties in index.less and smb-theme.js, along with new variables in vars.less.
packages/vue/src/cascader/*.vue Modified import statements, added HighlightQuery directive in pc.vue, and reorganized package.json with new types and dependencies.
packages/vue/src/transfer-panel/src/pc.vue Added clearable property to input and modified icon imports for improved interaction.

Sequence Diagram(s)

sequenceDiagram
    participant A as User
    participant B as UI Component
    participant C as Input Field
    participant D as Icon

    A->>B: Interacts with the component
    B->>C: Triggers input event
    C->>D: Updates icon visibility based on input state
    D-->>C: Displays search icon if applicable
    C-->>B: Updates input value
    B-->>A: Reflects changes in the UI
Loading

🐰 In the meadow where the code does flow,
New fonts and themes in a vibrant show.
With padding adjusted and icons in place,
A clearer design full of grace.
Hopping through changes, we celebrate! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@shenjunjian shenjunjian changed the title Dev smb design fix(theme): update smb design for tree/tooltip/transfer/cascader components Aug 22, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 963b5f1 and cf5150d.

Files selected for processing (26)
  • examples/sites/demos/pc/app/tooltip/content-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/tooltip/content.vue (1 hunks)
  • packages/design/smb/index.ts (2 hunks)
  • packages/design/smb/src/transfer-panel/index.ts (1 hunks)
  • packages/renderless/src/transfer-panel/vue.ts (3 hunks)
  • packages/theme/src/cascader-node/smb-theme.js (2 hunks)
  • packages/theme/src/cascader/smb-theme.js (1 hunks)
  • packages/theme/src/input/index.less (2 hunks)
  • packages/theme/src/input/smb-theme.js (1 hunks)
  • packages/theme/src/input/vars.less (1 hunks)
  • packages/theme/src/select/aurora-theme.js (1 hunks)
  • packages/theme/src/select/index.less (2 hunks)
  • packages/theme/src/select/smb-theme.js (1 hunks)
  • packages/theme/src/select/vars.less (1 hunks)
  • packages/theme/src/theme.config.js (2 hunks)
  • packages/theme/src/tooltip/smb-theme.js (1 hunks)
  • packages/theme/src/transfer/index.less (5 hunks)
  • packages/theme/src/transfer/smb-theme.js (2 hunks)
  • packages/theme/src/transfer/vars.less (3 hunks)
  • packages/theme/src/tree/index.less (1 hunks)
  • packages/theme/src/tree/smb-theme.js (1 hunks)
  • packages/theme/src/tree/vars.less (1 hunks)
  • packages/vue/src/cascader-node/src/pc.vue (2 hunks)
  • packages/vue/src/cascader/package.json (1 hunks)
  • packages/vue/src/cascader/src/pc.vue (3 hunks)
  • packages/vue/src/transfer-panel/src/pc.vue (3 hunks)
Files skipped from review due to trivial changes (12)
  • examples/sites/demos/pc/app/tooltip/content-composition-api.vue
  • examples/sites/demos/pc/app/tooltip/content.vue
  • packages/design/smb/src/transfer-panel/index.ts
  • packages/theme/src/cascader/smb-theme.js
  • packages/theme/src/input/vars.less
  • packages/theme/src/select/aurora-theme.js
  • packages/theme/src/select/index.less
  • packages/theme/src/select/smb-theme.js
  • packages/theme/src/select/vars.less
  • packages/theme/src/tooltip/smb-theme.js
  • packages/theme/src/tree/index.less
  • packages/theme/src/tree/vars.less
Additional comments not posted (29)
packages/theme/src/tree/smb-theme.js (1)

8-11: LGTM! Enhancements to tree node padding properties.

The addition of ti-tree-node-padding-left, ti-tree-padding-top, and ti-tree-padding-bottom properties enhances the customization capabilities of the theme.

packages/design/smb/index.ts (1)

Line range hint 17-40: LGTM! Addition of TransferPanel component.

The inclusion of TransferPanel in the exports enhances the module's functionality and maintains consistency in the export structure.

packages/vue/src/cascader/package.json (1)

3-32: LGTM! Improvements to package metadata and dependencies.

The addition of type, license, and devDependencies fields, along with the reordering of dependencies, enhances the package's clarity and usability.

packages/theme/src/cascader-node/smb-theme.js (2)

4-4: Update aligns with design standards for disabled states.

The background color for disabled nodes has been updated to use a more appropriate color variable for disabled states. This enhances the visual feedback for users.


14-14: Icon font size adjustment may impact visual hierarchy.

The font size for node icons has been reduced. Ensure this change aligns with the overall design specifications and does not negatively impact readability or accessibility.

packages/theme/src/transfer/smb-theme.js (2)

5-5: Border color update enhances visual feedback.

The border color has been changed to reflect a normal state, improving the component's visual feedback.


18-22: New padding properties improve layout control.

The addition of padding properties for the header and body sections allows for more precise layout adjustments, enhancing the overall design and user experience.

packages/theme/src/input/smb-theme.js (1)

22-25: New suffix positioning properties enhance styling flexibility.

The addition of properties for suffix positioning allows for better control over vertical alignment across different input sizes, improving the component's adaptability to various design needs.

packages/theme/src/theme.config.js (2)

26-26: Addition of Cascader theming option.

The new entry 'cascader-border': 'cascader-dropdown' enhances the theming options for the Cascader component, allowing for more granular customization of its dropdown appearance.


26-26: Removal of color-related theming options.

The removal of 'color-select-panel': 'color-select-panel' and 'color-picker': 'color-picker' suggests a potential refactoring or deprecation of these components. Ensure that these components are no longer in use or have been replaced with alternatives.

Run the following script to verify the usage of the removed theming options:

packages/vue/src/cascader-node/src/pc.vue (1)

Line range hint 18-30: Update loading icon representation.

The change from iconLoading to iconLoadingShadow suggests an update in the visual feedback for loading states. Ensure that the new icon aligns with the design specifications and provides the desired user experience.

Run the following script to verify the usage of the new icon:

Verification successful

Consistent usage of iconLoadingShadow confirmed.

The iconLoadingShadow is consistently used across multiple files, including the component under review and example files. This suggests that the change aligns with the design specifications and provides the desired visual feedback for loading states.

  • packages/vue/src/cascader-node/src/pc.vue
  • examples/sites/demos/pc/app/loading/spinner.vue
  • examples/sites/demos/pc/app/loading/spinner-composition-api.vue
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new loading icon.

# Test: Search for the usage of 'iconLoadingShadow' to ensure consistency.
rg --type vue 'iconLoadingShadow'

Length of output: 61


Script:

#!/bin/bash
# Description: Verify the usage of the new loading icon.

# Test: Search for the usage of 'iconLoadingShadow' across all files.
rg 'iconLoadingShadow'

Length of output: 709

packages/renderless/src/transfer-panel/vue.ts (2)

Line range hint 49-74: Enhance state initialization with design configuration.

The initState function now includes designConfig, allowing for more flexible state management. This change introduces inputBoxType and showInputSearch, improving the component's customization capabilities.

Tools
Biome

[error] 69-69: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 71-71: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


136-144: Enhance renderless function with design configuration.

The renderless function now accepts designConfig, ensuring that design specifications are passed down to initState. This enhancement supports more dynamic and responsive UI behavior.

packages/vue/src/transfer-panel/src/pc.vue (3)

35-37: Enhancement: Added clearable property and @clear event.

The addition of the clearable property and @clear event handler improves user interaction by allowing users to clear the input field easily. Ensure that the clearQuery method is correctly implemented to handle this event.


42-43: Conditional Rendering: Search Icon.

The search icon is now conditionally rendered based on state.showInputSearch. This provides a more contextual user interface by displaying the search icon only when necessary.


132-132: Import Update: Added iconSearch.

The iconSearch import is now included, which supports the new search icon feature in the input component. Ensure that the icon is correctly used and styled.

packages/vue/src/cascader/src/pc.vue (4)

168-168: Directive Usage: v-highlight-query.

The v-highlight-query directive is used to highlight text based on user input. This improves the user interface by making it easier to identify matching text. Ensure that the directive is correctly implemented and tested.


172-172: Template Update: Span Element for Item Text.

The item text is now wrapped in a span element, which may improve styling and layout control. Ensure that this change does not affect existing styles or functionality.


193-193: Import Update: Added HighlightQuery.

The HighlightQuery directive is imported to enhance text highlighting functionality. Ensure that it is correctly integrated and utilized within the component.


249-249: Directive Declaration: Added HighlightQuery.

The HighlightQuery directive is added to the directives object, allowing its use within the component. Verify that it is correctly registered and functional.

packages/theme/src/input/index.less (4)

172-172: CSS Enhancement: Dynamic Suffix Positioning.

The top property for suffix elements is now set using the var(--ti-input-suffix-top) variable, allowing for dynamic styling. This enhances flexibility and maintainability. Ensure that the variable is defined and used correctly across different input sizes.


276-278: CSS Enhancement: Medium Input Suffix Positioning.

The top property for medium input suffix elements is now set using var(--ti-input-suffix-top-medium). This allows for specific styling adjustments for medium-sized inputs.


283-285: CSS Enhancement: Small Input Suffix Positioning.

The top property for small input suffix elements is now set using var(--ti-input-suffix-top-small). This allows for specific styling adjustments for small-sized inputs.


290-292: CSS Enhancement: Mini Input Suffix Positioning.

The top property for mini input suffix elements is now set using var(--ti-input-suffix-top-mini). This allows for specific styling adjustments for mini-sized inputs.

packages/theme/src/transfer/vars.less (2)

96-97: Addition of --ti-transfer-panel-body-padding-left is appropriate.

This new variable provides better control over the panel body padding, enhancing layout flexibility.


97-97: Modification of --ti-transfer-panel-body-filter-height looks good.

The inclusion of additional padding can improve layout consistency. Verify that this change aligns with the design specifications.

packages/theme/src/transfer/index.less (3)

96-98: Addition of non-disabled button style is appropriate.

This rule ensures consistent background color for enabled buttons, enhancing visual consistency.


149-149: Addition of padding-left for panel body is appropriate.

This change enhances layout consistency within the panel body.


258-261: Change from padding-left to margin-left for filter component is justified.

The rationale for this change is sound, as it prevents interference with input slot positioning and maintains visual separation.

Copy link

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cf5150d and 6a712bd.

Files selected for processing (5)
  • packages/theme/src/input/index.less (2 hunks)
  • packages/theme/src/input/smb-theme.js (1 hunks)
  • packages/theme/src/input/vars.less (1 hunks)
  • packages/theme/src/select/index.less (2 hunks)
  • packages/theme/src/select/vars.less (1 hunks)
Files skipped from review due to trivial changes (2)
  • packages/theme/src/input/vars.less
  • packages/theme/src/select/index.less
Files skipped from review as they are similar to previous changes (3)
  • packages/theme/src/input/index.less
  • packages/theme/src/input/smb-theme.js
  • packages/theme/src/select/vars.less

@shenjunjian shenjunjian changed the title fix(theme): update smb design for tree/tooltip/transfer/cascader components fix(theme): [tree,tooltip,transfer,cascader,input] update smb design for tree/tooltip/transfer/cascader components Aug 22, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6a712bd and 00987b5.

Files selected for processing (1)
  • packages/theme/src/tree/index.less (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/theme/src/tree/index.less

@shenjunjian shenjunjian added the feature 新功能 label Aug 23, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 00987b5 and 134cd47.

Files selected for processing (1)
  • packages/theme/src/theme.config.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/theme/src/theme.config.js

@zzcr zzcr merged commit 276e2ad into opentiny:dev Aug 26, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 新功能
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants