-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Static CSS and Flex Component for Yorkie Homepage #145
Conversation
Warning Rate limit exceeded@chacha912 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 52 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe recent changes enhance the Storybook application by refining component documentation and layouts, introducing a new Changes
Sequence Diagram(s)sequenceDiagram
participant A as User
participant B as Storybook
participant C as Flex Component
participant D as Button Component
A->>B: Open Storybook
B->>D: Render Button Stories
D->>C: Use Flex for Layout
C->>B: Return Rendered Flex Layout
B->>A: Display Updated Button Stories
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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
Outside diff range, codebase verification and nitpick comments (1)
packages/core/src/flex/Flex.tsx (1)
7-15
: Consider adding prop types for better documentation.Adding prop types can improve the documentation and usability of the component.
+ /** + * The direction of the flex container. + */ + direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse'; + /** + * Used to align child elements along the main axis of the container. + */ + justify?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly'; + /** + * Used to align child elements along the cross axis of the container. + */ + align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'; + /** + * The gap between flex items. + */ + gap?: number;
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (14)
- apps/storybook/package.json (1 hunks)
- apps/storybook/src/stories/button/Button.mdx (6 hunks)
- apps/storybook/src/stories/button/Button.stories.tsx (5 hunks)
- apps/storybook/src/stories/flex/Flex.mdx (1 hunks)
- apps/storybook/src/stories/flex/Flex.stories.tsx (1 hunks)
- packages/core/panda.config.ts (1 hunks)
- packages/core/panda/theme/breakpoints.ts (1 hunks)
- packages/core/panda/theme/semantic-tokens/colors.ts (1 hunks)
- packages/core/panda/theme/semantic-tokens/index.ts (1 hunks)
- packages/core/panda/theme/semantic-tokens/shadows.ts (1 hunks)
- packages/core/panda/theme/tokens/z-index.ts (3 hunks)
- packages/core/src/flex/Flex.tsx (1 hunks)
- packages/core/src/flex/index.ts (1 hunks)
- packages/core/src/index.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- apps/storybook/package.json
- packages/core/src/flex/index.ts
Additional context used
LanguageTool
apps/storybook/src/stories/flex/Flex.mdx
[uncategorized] ~30-~30: Loose punctuation mark.
Context: ... 4 `, }} /> ## Props(UNLIKELY_OPENING_PUNCTUATION)
Additional comments not posted (32)
packages/core/src/index.ts (1)
2-2
: LGTM! Verify the existence and correctness of theflex
module.The code changes are approved.
Ensure that the
flex
module is correctly implemented and available.Verification successful
The
flex
module is correctly implemented and available.The
flex
module located atpackages/core/src/flex/Flex.tsx
contains the following export statements:
export type FlexProps = HTMLStyledProps<'div'> & FlexProperties;
export const Flex = forwardRef<HTMLDivElement, FlexProps>((props: FlexProps, ref) => { ... });
This confirms that the module is correctly implemented and exports the necessary entities.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and correctness of the `flex` module. # Test: Check for the existence of the `flex` module. Expect: The file exists. fd 'flex.ts' packages/core/src # Test: Check for the export statement in the `flex` module. Expect: The module exports entities. rg --type ts 'export' packages/core/src/flex.tsLength of output: 176
Script:
#!/bin/bash # Description: Verify the existence and correctness of the `flex` module. # Test: Check for the export statement in the `flex` module. Expect: The module exports entities. rg --type tsx 'export' packages/core/src/flex/Flex.tsxLength of output: 82
Script:
#!/bin/bash # Description: Verify the existence and correctness of the `flex` module. # Test: Check for the export statement in the `flex` module. Expect: The module exports entities. rg --type typescript 'export' packages/core/src/flex/Flex.tsxLength of output: 96
Script:
#!/bin/bash # Description: Verify the existence and correctness of the `flex` module. # Test: Check for the export statement in the `flex` module. Expect: The module exports entities. rg 'export' packages/core/src/flex/Flex.tsxLength of output: 195
packages/core/panda/theme/breakpoints.ts (1)
3-6
: Verify alignment with design requirements and impact on layout.The breakpoint values have been significantly altered. Ensure that these changes align with the overall design requirements and do not introduce layout issues.
packages/core/panda/theme/semantic-tokens/shadows.ts (1)
3-3
: Verify the impact on the visual appearance of the UI.All shadow definitions have been removed. Ensure that this change does not negatively impact the visual appearance of the UI.
packages/core/panda/theme/semantic-tokens/index.ts (2)
7-9
: LGTM! The function definition is simplified and maintainable.The function now uses the imported
colors
andshadows
objects, which enhances maintainability.
3-3
: Ensure thecolors
import is correct.The
colors
object is now imported from./colors
. Verify that thecolors
module exports the expected structure.Verification successful
The
colors
import is correct.The
colors
object is correctly exported from thecolors
module.
export const colors = defineSemanticTokens.colors({
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `colors` module exports the expected structure. # Test: Search for the `colors` export. Expect: The `colors` object is correctly exported. rg --type javascript -A 5 $'export const colors'Length of output: 84
Script:
#!/bin/bash # Locate the file containing the `colors` export and verify its structure. # Find the file named `colors` in the `packages/core/panda/theme/semantic-tokens` directory. fd colors packages/core/panda/theme/semantic-tokens --extension ts --exec rg 'export const colors' {}Length of output: 157
packages/core/panda/theme/tokens/z-index.ts (1)
10-12
: LGTM! The newfloat
property enhances functionality.The new
float
property with a value of1
provides an additional option for managing element visibility and layering.apps/storybook/src/stories/flex/Flex.mdx (1)
1-36
: LGTM! The documentation for theFlex
component is clear and complete.The file includes sections for import, overview, and props, providing a comprehensive guide for using the
Flex
component.Tools
LanguageTool
[uncategorized] ~30-~30: Loose punctuation mark.
Context: ... 4 `, }} /> ## Props(UNLIKELY_OPENING_PUNCTUATION)
packages/core/src/flex/Flex.tsx (3)
1-3
: LGTM!The import statements are necessary and correctly used.
5-6
: LGTM!The type definition correctly extends
HTMLStyledProps
andFlexProperties
.
7-15
: LGTM!The
Flex
component correctly handles props and applies styles using styled-system.apps/storybook/src/stories/flex/Flex.stories.tsx (4)
1-3
: LGTM!The import statements are necessary and correctly used.
4-6
: LGTM!The property arrays are correctly defined and used.
7-45
: LGTM!The meta object is correctly defined and used.
47-62
: LGTM!The story object is correctly defined and used.
apps/storybook/src/stories/button/Button.mdx (3)
Line range hint
50-60
:
LGTM!The
<Flex>
component is correctly used and improves the layout for theSizes
example.
69-70
: LGTM!The note about the link style is clear and informative.
Line range hint
76-86
:
LGTM!The
<Flex>
component is correctly used and improves the layout for theVariant
example.packages/core/panda.config.ts (4)
24-28
: Visibility Control Properties Added.The properties
hideFrom
andhideBelow
are correctly added to enhance responsive design capabilities.
30-41
: Flexbox Layout Properties Added.The properties related to flexbox layout are correctly added, providing detailed control over element arrangement within a flex container.
43-52
: Positioning Properties Added.The properties for positioning are correctly added, providing tools for controlling the stacking context and positioning of elements.
54-70
: Dimension and Margin/Padding Control Properties Added.The properties for width, height, minWidth, minHeight, margin, and padding are correctly added, allowing for precise control over element sizing and spacing.
apps/storybook/src/stories/button/Button.stories.tsx (3)
2-2
: Import Statement Updated.The import statement is correctly updated to include the
Flex
component from@yorkie-ui/core
.
42-58
: ExpandedcolorPalette
Options.The
colorPalette
options are correctly expanded to include a broader selection of predefined color palettes.
Line range hint
88-98
:
Improved Layout Control withFlex
Component.The
Flex
component is correctly used to wrap the buttons in theSizes
andVariant
story exports, improving layout control and visual presentation.Also applies to: 106-116
packages/core/panda/theme/semantic-tokens/colors.ts (8)
3-54
: Gray Color Definitions Added.The various shades of gray are correctly defined using semantic tokens.
55-90
: Red Color Definitions Added.The various shades of red are correctly defined using semantic tokens.
91-126
: Orange Color Definitions Added.The various shades of orange are correctly defined using semantic tokens.
127-162
: Yellow Color Definitions Added.The various shades of yellow are correctly defined using semantic tokens.
163-198
: Green Color Definitions Added.The various shades of green are correctly defined using semantic tokens.
199-234
: Blue Color Definitions Added.The various shades of blue are correctly defined using semantic tokens.
235-270
: Purple Color Definitions Added.The various shades of purple are correctly defined using semantic tokens.
271-420
: Remaining Color Definitions Added.The remaining color categories such as white, transparent, disabled, accent, neutral, success, info, warning, and danger are correctly defined using semantic tokens.
c4c6c36
to
255c7dd
Compare
What this PR does / why we need it:
I added the static CSS and Flex component because they were needed to replace the button component on the Yorkie Homepage.: yorkie-team/yorkie-team.github.io#155
Special notes for your reviewer:
I added only the necessary styles to the static CSS, but since we can't predict which styles users will use, we might need to prepare all styles in static CSS. This could increase the size and build time, so I'm considering whether to structure the Yorkie UI in a copy-paste format like Park UI or Shadcn UI.
Which issue(s) this PR fixes:
Fixes #
Checklist:
Summary by CodeRabbit
New Features
Flex
component for improved flexible layout management.Flex
documentation page and stories to showcase its capabilities.Bug Fixes
@storybook/addon-themes
for better compatibility.Refactor
Documentation
Flex
component, including usage examples and props details.