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

updated panels,popup styles #72

Merged
merged 2 commits into from
May 29, 2024
Merged

updated panels,popup styles #72

merged 2 commits into from
May 29, 2024

Conversation

Swathi-eGov
Copy link
Contributor

No description provided.

Copy link
Contributor

coderabbitai bot commented May 29, 2024

Walkthrough

The updates span various CSS and JavaScript files, primarily focusing on enhancing the styling and functionality of Panel and Popup components. Key changes include adding new classes, adjusting styles, refactoring logic for footer handling, and updating version numbers. These modifications aim to improve the visual presentation and responsiveness of the components across different devices.

Changes

Files/Directories Change Summary
react/css/README.md Updated Panel and Popup styles in version 1.8.2-coreui.21.
react/css/src/digitv2/components/panelcard.scss Added .without-footer class, adjusted padding values, included @apply max-w-full flex-wrap; directive within a media query block.
react/css/src/digitv2/components/panels.scss Added text-center to .digit-panel-message and line-height: normal; to .digit-panel-response.
react/css/src/digitv2/components/popUpV2.scss Added .without-footer class, adjusted padding values, included @apply max-w-full flex-wrap; directive within a media query block.
react/example/public/index.html Updated @egovernments/digit-ui-css version from 1.8.2-coreui.20 to 1.8.2-coreui.21.
react/ui-components/README.md Updated version to 0.0.1-beta.30, added note about updating Panel Animation Styles.
react/ui-components/src/atoms/Panels.js Added useDeviceType hook, modified IconRender function, introduced deviceType state variable, added getAnimationDimensions function, updated width and height values based on device type.
react/ui-components/src/atoms/PopUp.js Refactored footer children handling logic, sorted footer buttons, adjusted footer section rendering, updated class names and styles for better UI presentation.
react/ui-components/src/molecules/PanelCard.js Refactored footer children handling logic, conditional rendering of footer section, updated class names and styles based on presence of footer children.
react/ui-components/src/hoc/stories/PopUp.stories.js Introduced footerStyles prop with control type "object", added new stories showcasing this feature, adjusted existing stories to include footerStyles in arguments.
react/ui-components/src/molecules/stories/PanelCard.stories.js Added footerStyles control, updated commonArgs, added new stories for success and error panel cards with and without footer styles.
react/ui-components/src/hoc/stories/Panels.stories.js Updated animationProps object, changed noLoop property to loop for consistency.

Sequence Diagram(s) (Beta)

Silently ignored as the changes are too varied for a single sequence diagram.

Poem

In the land of code, where panels gleam,
We’ve added styles to fulfill a dream.
Footers now dance with shadows in tow,
Panels and Popups in a responsive flow.
With hooks and logic, our code’s refined,
A UI so polished, it’ll blow your mind! 🌟

Warning

Review ran into problems

Problems (1)
  • Git: Failed to clone repository. Please contact CodeRabbit support.

Tip

Early Access Features
  • gpt-4o model for chat

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 Configration 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.

Copy link
Contributor

@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: 2

Outside diff range and nitpick comments (1)
react/ui-components/src/atoms/PopUp.js (1)

Line range hint 188-192: Add keyboard accessibility for close button.

+ onKeyUp={(event) => { if (event.key === "Enter") props?.onClose(); }}

Adding a onKeyUp event handler to the close button improves accessibility by allowing keyboard users to trigger the close action.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between fb7e996 and 9791c1c.
Files ignored due to path filters (7)
  • react/css/package.json is excluded by !**/*.json
  • react/example/package.json is excluded by !**/*.json
  • react/modules/Project/package.json is excluded by !**/*.json
  • react/modules/core/package.json is excluded by !**/*.json
  • react/modules/sample/package.json is excluded by !**/*.json
  • react/package.json is excluded by !**/*.json
  • react/ui-components/package.json is excluded by !**/*.json
Files selected for processing (11)
  • react/css/README.md (1 hunks)
  • react/css/src/digitv2/components/panelcard.scss (4 hunks)
  • react/css/src/digitv2/components/panels.scss (2 hunks)
  • react/css/src/digitv2/components/popUpV2.scss (4 hunks)
  • react/example/public/index.html (1 hunks)
  • react/ui-components/README.md (1 hunks)
  • react/ui-components/src/atoms/Panels.js (5 hunks)
  • react/ui-components/src/atoms/PopUp.js (5 hunks)
  • react/ui-components/src/hoc/stories/PopUp.stories.js (7 hunks)
  • react/ui-components/src/molecules/PanelCard.js (3 hunks)
  • react/ui-components/src/molecules/stories/PanelCard.stories.js (4 hunks)
Additional Context Used
LanguageTool (3)
react/css/README.md (2)

Near line 20: Possible missing comma found.
Context: ...it UI's ``` ## Usage After adding the dependency make sure you have this dependency in ...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 92: This phrase is duplicated. You should probably use “DIGIT Core” only once.
Context: ...ishnakole-wtt-egov] ## Published from DIGIT Core Digit Core Repo (https://github.com/egovernments/D...
Rule ID: PHRASE_REPETITION

react/ui-components/README.md (1)

Near line 18: Possible missing comma found.
Context: ...ssion's ``` ## Usage After adding the dependency make sure you have this dependency in ...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA

Markdownlint (23)
react/css/README.md (9)

90: Expected: 0 or 2; Actual: 1
Trailing spaces


92: Expected: 0 or 2; Actual: 1
Trailing spaces


42: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


88: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines


92: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


41: null
Fenced code blocks should be surrounded by blank lines


87: null
Fenced code blocks should be surrounded by blank lines


93: null
Bare URL used


97: null
Files should end with a single newline character

react/ui-components/README.md (14)

43: Expected: 0 or 2; Actual: 1
Trailing spaces


96: Expected: 0 or 2; Actual: 1
Trailing spaces


57: Expected: 1; Actual: 2
Multiple consecutive blank lines


105: Expected: 1; Actual: 2
Multiple consecutive blank lines


106: Expected: 1; Actual: 3
Multiple consecutive blank lines


126: Expected: 1; Actual: 2
Multiple consecutive blank lines


145: Expected: 1; Actual: 2
Multiple consecutive blank lines


42: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


99: null
Fenced code blocks should be surrounded by blank lines


113: null
Fenced code blocks should be surrounded by blank lines


117: null
Fenced code blocks should be surrounded by blank lines


119: null
Fenced code blocks should be surrounded by blank lines


129: null
Bare URL used


137: null
Bare URL used

Biome (53)
react/ui-components/src/atoms/Panels.js (11)

47-50: This else clause can be omitted because previous branches break early.


73-73: Useless case clause.


94-98: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.


100-106: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.


104-104: Unnecessary use of boolean literals in conditional expression.


105-105: Unnecessary use of boolean literals in conditional expression.


111-115: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.


117-123: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.


121-121: Unnecessary use of boolean literals in conditional expression.


122-122: Unnecessary use of boolean literals in conditional expression.


133-133: Missing key property for this element in iterable.

react/ui-components/src/atoms/PopUp.js (6)

76-79: This else clause can be omitted because previous branches break early.


188-192: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.


34-34: This hook does not specify all of its dependencies: checkOverflow


34-34: This hook specifies more dependencies than necessary: props.children


50-50: This hook does not specify all of its dependencies: checkOverflow


50-50: This hook does not specify all of its dependencies: onResize

react/ui-components/src/hoc/stories/PopUp.stories.js (20)

110-116: Missing key property for this element in iterable.


117-123: Missing key property for this element in iterable.


127-133: Missing key property for this element in iterable.


137-143: Missing key property for this element in iterable.


144-150: Missing key property for this element in iterable.


151-157: Missing key property for this element in iterable.


158-164: Missing key property for this element in iterable.


165-171: Missing key property for this element in iterable.


172-178: Missing key property for this element in iterable.


182-182: Missing key property for this element in iterable.


183-187: Missing key property for this element in iterable.


191-191: Missing key property for this element in iterable.


192-196: Missing key property for this element in iterable.


197-201: Missing key property for this element in iterable.


202-206: Missing key property for this element in iterable.


207-211: Missing key property for this element in iterable.


212-216: Missing key property for this element in iterable.


217-221: Missing key property for this element in iterable.


222-226: Missing key property for this element in iterable.


227-231: Missing key property for this element in iterable.

react/ui-components/src/molecules/PanelCard.js (5)

91-91: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.


33-33: This hook does not specify all of its dependencies: checkOverflow


33-33: This hook specifies more dependencies than necessary: props.children


49-49: This hook does not specify all of its dependencies: checkOverflow


49-49: This hook does not specify all of its dependencies: onResize

react/ui-components/src/molecules/stories/PanelCard.stories.js (11)

99-105: Missing key property for this element in iterable.


106-112: Missing key property for this element in iterable.


116-122: Missing key property for this element in iterable.


126-132: Missing key property for this element in iterable.


133-139: Missing key property for this element in iterable.


140-146: Missing key property for this element in iterable.


147-153: Missing key property for this element in iterable.


154-160: Missing key property for this element in iterable.


161-167: Missing key property for this element in iterable.


171-175: Missing key property for this element in iterable.


179-183: Missing key property for this element in iterable.

Additional comments not posted (15)
react/example/public/index.html (1)

12-12: Update to CSS version 1.8.2-coreui.21 is noted.

Ensure that this version is compatible with all other dependencies and does not introduce any breaking changes.

react/css/src/digitv2/components/panels.scss (2)

44-44: Added text centering and normal line-height for better text alignment and readability.


70-70: Normalizing line-height for .digit-panel-response enhances consistency in text presentation.

react/css/README.md (1)

45-45: Changelog updated to reflect the latest version changes.

react/ui-components/src/molecules/PanelCard.js (1)

Line range hint 59-117: Refactoring to handle footerChildren more efficiently by checking their presence before slicing and sorting.

Ensure that the sorting function correctly prioritizes button types as intended.

react/ui-components/README.md (1)

61-61: Updated changelog to reflect new styles for panel animations.

react/ui-components/src/atoms/Panels.js (1)

Line range hint 1-120: Introduction of useDeviceType hook to dynamically adjust UI components based on device size, and updates to animation dimensions based on device type.

Verify that the useDeviceType hook behaves as expected across all target devices.

react/css/src/digitv2/components/panelcard.scss (2)

57-58: Consistent padding adjustments for .with-shadow and .without-footer.

The changes ensure that the padding remains consistent across different screen sizes for the .with-shadow and .without-footer classes. This is a good practice for maintaining a uniform appearance in responsive designs.

Also applies to: 68-69, 79-80


120-120: Use of @apply directive enhances CSS maintainability.

The use of the @apply directive for max-w-full and flex-wrap in .digit-panelcard-footer-buttons is a good practice as it makes the CSS more maintainable and readable by grouping common properties.

react/css/src/digitv2/components/popUpV2.scss (2)

143-144: Consistent padding adjustments for .with-shadow and .without-footer.

Similar to the panelcard.scss, these changes ensure consistent padding across different screen sizes for the .with-shadow and .without-footer classes in the popup component, maintaining a uniform appearance.

Also applies to: 154-155, 165-166


200-200: Use of @apply directive enhances CSS maintainability.

Applying max-w-full and flex-wrap to .digit-popup-footer-buttons using the @apply directive is beneficial for maintainability and readability, similar to the changes in panelcard.scss.

react/ui-components/src/molecules/stories/PanelCard.stories.js (2)

65-67: Added footerStyles prop to control customization.

The addition of the footerStyles prop in the story configuration allows for better customization of the footer styles in PanelCard components, enhancing flexibility for developers.


239-250: Ensure consistency in story configurations.

The new stories SuccessPanelCardWithFooterStyles and ErrorPanelCardWithFooterStyles demonstrate the usage of the footerStyles prop effectively, providing examples of how to customize footer styles.

Also applies to: 314-325

react/ui-components/src/hoc/stories/PopUp.stories.js (2)

75-77: Added footerStyles prop to control customization.

The addition of the footerStyles prop in the story configuration for PopUp components is a good practice, allowing for enhanced customization and flexibility in styling.


321-335: Demonstration of footer style customization in stories.

The stories DefaultWithFooterStyles and AlertWithFooterStyles effectively demonstrate the customization capabilities provided by the footerStyles prop, showcasing practical examples of its usage.

Also applies to: 408-420

Copy link
Contributor

@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 9791c1c and 9dc5181.
Files selected for processing (3)
  • react/ui-components/src/atoms/Panels.js (5 hunks)
  • react/ui-components/src/hoc/stories/Panels.stories.js (3 hunks)
  • react/ui-components/src/molecules/stories/PanelCard.stories.js (4 hunks)
Files skipped from review due to trivial changes (1)
  • react/ui-components/src/hoc/stories/Panels.stories.js
Files skipped from review as they are similar to previous changes (2)
  • react/ui-components/src/atoms/Panels.js
  • react/ui-components/src/molecules/stories/PanelCard.stories.js

@jagankumar-egov jagankumar-egov merged commit 76e334d into develop May 29, 2024
1 check passed
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