Skip to content

Progress bar Sizes #1153

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Progress bar Sizes #1153

wants to merge 11 commits into from

Conversation

g-charan
Copy link
Contributor

@g-charan g-charan commented Jun 12, 2025

image

Added different sizes for the progress bar component in master list for issue #937

Summary by CodeRabbit

  • New Features

    • Added support for multiple progress bar sizes: small, medium, large, and x-large.
    • Progress bars now include size and variant properties for enhanced customization and testing.
    • Storybook updated with a new story demonstrating all available progress bar sizes.
    • Introduced new Checkbox, Slider, and Select components with subcomponents and context support.
    • Added search functionality within Select dropdowns.
    • Added keyboard interaction and active item tracking to Select components.
    • Introduced CheckboxPrimitive and Slider UI primitives with Storybook examples.
  • Tests

    • Updated tests to include size and variant properties on progress bar components.
  • Style

    • Updated styles to visually support the new progress bar size options.
    • Added new styles for Checkbox, Select search input, and Slider components.
    • Extended default theme to include Checkbox and Slider styles.
  • Documentation

    • Enhanced code block component with scrollable area for better code viewing.
  • Chores

    • Reformatted color token files for consistent style.

Copy link
Contributor

coderabbitai bot commented Jun 12, 2025

Walkthrough

Support for multiple size and variant options was added to the Progress component. This includes extending context and props with size and variant properties, updating the root component to propagate and render related data attributes, enhancing styles for different sizes, adding a Storybook example for sizes, and introducing corresponding tests for size and variant attributes.

Additionally, new UI components Checkbox and Slider were introduced with their contexts, subcomponents, stories, and styles. The Select and SelectPrimitive components were extended with a new Search subcomponent enabling searchable dropdowns. The CodeBlock component was enhanced with scrollable code area support. Several primitive checkbox components and their stories were added. Styling updates were made for checkbox, select search, and slider components. Minor formatting and newline fixes were applied.

Changes

File(s) Change Summary
src/components/ui/Progress/contexts/ProgressContext.tsx Added optional size and variant properties to context type and default value.
src/components/ui/Progress/fragments/ProgressRoot.tsx Added optional size and variant props; passed to context and root element as data attributes.
src/components/ui/Progress/stories/Progress.stories.tsx Added Sizes story demonstrating Progress in four sizes; minor formatting tweaks in existing story.
src/components/ui/Progress/tests/Progress.test.tsx Updated test component to accept size and variant props; added data-testid attribute.
styles/themes/components/progress.scss Added CSS rules for small, medium, large, and x-large size variants using data attributes.
src/components/ui/Checkbox/Checkbox.tsx Added new Checkbox component with subcomponents Root and Indicator.
src/components/ui/Checkbox/context/CheckboxContext.tsx Added CheckboxContext with default rootClass.
src/components/ui/Checkbox/fragments/CheckboxRoot.tsx Added CheckboxRoot component providing context and rendering primitive root.
src/components/ui/Checkbox/fragments/CheckboxIndicator.tsx Added CheckboxIndicator component rendering primitive indicator.
src/components/ui/Checkbox/stories/Checkbox.stories.tsx Added Storybook stories for Checkbox component with custom tick icon.
src/components/ui/Select/Select.tsx Added Select.Search subcomponent.
src/components/ui/Select/fragments/SelectSearch.tsx Added SelectSearch component rendering a search input inside Select.
src/components/ui/Select/stories/Select.stories.tsx Added <Select.Search/> inside GroupExample story.
src/components/ui/Slider/Slider.tsx Added new Slider component with subcomponents Root, Track, Range, Thumb.
src/components/ui/Slider/context/SliderContext.tsx Added SliderContext with state and setters for value, min, max, and rootClass.
src/components/ui/Slider/fragments/SliderRoot.tsx Added SliderRoot component managing slider state and pointer events.
src/components/ui/Slider/fragments/SliderTrack.tsx Added SliderTrack component rendering track div.
src/components/ui/Slider/fragments/SliderRange.tsx Added SliderRange component rendering filled range with dynamic width.
src/components/ui/Slider/fragments/SliderThumb.tsx Added SliderThumb component rendering thumb with focusable hidden input.
src/components/ui/Slider/stories/Slider.stories.tsx Added Storybook stories for Slider component with nested subcomponents.
src/core/primitives/Checkbox/context/CheckboxPrimitiveContext.tsx Added CheckboxPrimitiveContext initialized with empty object.
src/core/primitives/Checkbox/fragments/CheckboxPrimitiveRoot.tsx Added CheckboxPrimitiveRoot managing checked state and providing context.
src/core/primitives/Checkbox/fragments/CheckboxPrimitiveIndicator.tsx Added CheckboxPrimitiveIndicator rendering children conditionally based on checked state.
src/core/primitives/Checkbox/fragments/CheckboxPrimitiveTrigger.tsx Added CheckboxPrimitiveTrigger toggling checked state on click.
src/core/primitives/Checkbox/index.tsx Added CheckboxPrimitive component with Root and Indicator subcomponents.
src/core/primitives/Checkbox/stories/CheckboxPrimitive.stories.tsx Added Storybook story for CheckboxPrimitive with custom tick icon.
src/core/primitives/Select/Select.tsx Added SelectPrimitive.Search subcomponent.
src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx Extended SelectPrimitiveContextType with activeItemValue and setter.
src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx Added keyboard handler for Enter key to select active item.
src/core/primitives/Select/fragments/SelectPrimitiveItem.tsx Replaced ButtonPrimitive with Primitive.div; added focus state and data-active attribute.
src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx Added activeItemValue state and setter; switched from useEffect to useLayoutEffect for offset calculation.
src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx Added SelectPrimitiveSearch component with filtering and keyboard navigation support.
src/core/primitives/Select/stories/Select.stories.tsx Added SearchSelect story demonstrating SelectPrimitive with search input and grouped items.
src/components/ui/Progress/tests/Progress.test.tsx Updated test component to accept size and variant props; added data-testid attribute.
src/components/ui/Progress/stories/Progress.stories.tsx Added Sizes story demonstrating Progress in four sizes; minor formatting tweaks in existing story.
src/components/ui/Progress/fragments/ProgressRoot.tsx Added optional size and variant props; passed to context and root element as data attributes.
src/components/ui/Progress/contexts/ProgressContext.tsx Added optional size and variant properties to context type and default value.
src/components/ui/Progress/tests/Progress.test.tsx Updated test component to accept size and variant props; added data-testid attribute.
src/components/ui/Progress/stories/Progress.stories.tsx Added Sizes story demonstrating Progress in four sizes; minor formatting tweaks in existing story.
styles/themes/components/progress.scss Added CSS rules for small, medium, large, and x-large size variants using data attributes.
src/components/ui/CodeBlock/helpers/CodeBlock.js Replaced inline scroll styles on <code> with scrollable ScrollArea components for better scrolling UI.
styles/themes/components/checkbox.scss Added styles for checkbox component including size, border, background, and hover effects.
styles/themes/components/select.scss Added styles for .rad-ui-select-search input and [data-active="true"] select items.
styles/themes/components/slider.scss Added styles for slider container, track, range, and thumb elements.
styles/themes/default.scss Imported checkbox and slider component styles.
docs/app/docs/layout.tsx Added newline at end of file.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ProgressRoot
    participant ProgressContext
    participant Styles

    User->>ProgressRoot: Render with size and variant props
    ProgressRoot->>ProgressContext: Provide size and variant in context
    ProgressRoot->>ProgressRoot: Generate data-progress-size and data-progress-variant attributes
    ProgressRoot->>Styles: Apply styles based on data attributes
Loading
sequenceDiagram
    participant User
    participant SliderRoot
    participant SliderContext
    participant SliderTrack
    participant SliderThumb
    participant SliderRange

    User->>SliderRoot: Interact (click, pointer events)
    SliderRoot->>SliderContext: Update value state
    SliderRoot->>SliderTrack: Render track
    SliderRoot->>SliderRange: Render filled range based on value
    SliderRoot->>SliderThumb: Render thumb positioned by value
Loading
sequenceDiagram
    participant User
    participant SelectPrimitiveRoot
    participant SelectPrimitiveSearch
    participant SelectPrimitiveContent
    participant SelectPrimitiveItem

    User->>SelectPrimitiveSearch: Type search query
    SelectPrimitiveSearch->>SelectPrimitiveContent: Filter items
    User->>SelectPrimitiveContent: Navigate with keyboard
    SelectPrimitiveContent->>SelectPrimitiveItem: Highlight active item
    User->>SelectPrimitiveContent: Press Enter
    SelectPrimitiveContent->>SelectPrimitiveRoot: Trigger handleSelect with active item
Loading

Suggested labels

automerge

Suggested reviewers

  • kotAPI

Poem

A hop, a skip, a progress bar—
Now in sizes near and far!
Small and large, and variants too,
This bunny’s cheering just for you.
With tests and stories, styles anew,
Progress shines in every hue!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30142b6 and 09f69d0.

📒 Files selected for processing (1)
  • styles/themes/components/progress.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • styles/themes/components/progress.scss
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

minValue: number;
maxValue: number;
children: React.ReactNode;
customRootClass?: string;
}

const ProgressRoot = ({ value = 0, minValue = 0, maxValue = 100, children, customRootClass }: ProgressRootProps) => {
const ProgressRoot = ({ value = 0, minValue = 0, maxValue = 100,size='', children, customRootClass }: ProgressRootProps) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

size should have default value

Copy link
Collaborator

Choose a reason for hiding this comment

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

no, it wont be headless if it has defaults

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: 1

🧹 Nitpick comments (1)
src/components/ui/Progress/contexts/ProgressContext.tsx (1)

17-18: Empty-string defaults conflict with the “optional” contract

size and variant are declared optional but the default context value sets them to ''. Components that rely on truthiness (if (size) …) will treat '' as “absent” but TypeScript distinguishes undefined from the empty string, so the runtime behaviour and the type contract diverge.

Consider either

  1. removing those keys from the default object altogether, or
  2. initialising them with undefined:
-    size: '',
-    variant: '',
+    // size and variant intentionally left undefined; they will be supplied by <ProgressRoot>

This keeps the semantics aligned and avoids accidental styling overrides caused by an empty data-attribute value.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cfcbb41 and 56f4e18.

📒 Files selected for processing (3)
  • src/components/ui/Progress/contexts/ProgressContext.tsx (1 hunks)
  • src/components/ui/Progress/fragments/ProgressRoot.tsx (1 hunks)
  • src/components/ui/Progress/tests/Progress.test.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/ui/Progress/fragments/ProgressRoot.tsx
  • src/components/ui/Progress/tests/Progress.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

<ProgressContext.Provider value={sendValues}>
<Primitive.div
className={clsx(rootClass)}
data-testid={`${COMPONENT_NAME.toLowerCase()}-bar-component`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what are we using this for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to write test cases to check the attributes

Copy link
Collaborator

Choose a reason for hiding this comment

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

The main component shouldn't have any extra attributes, the tests should pass this attribute if required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok will make that change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to remove the test cases for the component as I have to access the first element in the progress component but neither does it have a role or a key that I can access it with. Thats why I have added the testId, the progressbar role accesses the inside element where the data attributes are not present.

Copy link
Collaborator

Choose a reason for hiding this comment

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

you shouldnt be adding attributes that will help your tests pass

every attribute that is shipped with a component carries value and meaning - arbitrary/low value attributes cannot be afforded to be shipped with the library

what you might find useful for testing, the user will have absolutely no use for it and components need to be added keeping the user/dev in mind

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it I will remove them.

&[data-progress-size="x-large"] {
height: 16px;

.rad-ui-progress-indicator {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why so much repetition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will change that

@g-charan
Copy link
Contributor Author

I have removed the prev testId attribute and simplified the recurring code in scss.

@kotAPI
Copy link
Collaborator

kotAPI commented Jul 6, 2025

lint issues

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: 23

🔭 Outside diff range comments (2)
docs/components/layout/Documentation/helpers/CodeBlock.js (1)

45-61: Remove unused height/maxHeight logic.

The height and maxHeight variables are calculated but no longer used in the ScrollArea implementation, making this code redundant.

Apply this diff to remove the unused logic:

-let height = 'auto';
-let maxHeight = 'auto';
-
-if(expanded) {
-    if(!inline) {
-        height = 'auto';
-        maxHeight = 640;
-    }
-
-}
-else{
-    if(!inline) {
-        height = 180;
-        maxHeight = 640;
-    }
-
-}
src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (1)

2-2: Remove unused imports.

The linting pipeline correctly identifies unused imports: useEffect, Primitive, setIsOpen, and selectedValue.

-import React, { useContext, useEffect } from 'react';
+import React, { useContext } from 'react';

Also remove the unused Primitive import:

-import Primitive from '../../Primitive';
🧹 Nitpick comments (7)
docs/components/layout/Documentation/helpers/CodeBlock.js (1)

101-102: Remove unnecessary blank lines.

These extra blank lines at the end of the component are unnecessary and should be removed for cleaner code.

Apply this diff to remove the extra blank lines:

-
src/components/ui/Slider/fragments/SliderRange.tsx (1)

6-10: Consider if children prop is necessary for this component.

The SliderRange component appears to be a visual indicator for the filled portion of the slider. Consider whether the children prop is actually needed for this use case, as range indicators typically don't contain child elements.

-const SliderRange = ({ children }: { children: React.ReactNode }) => {
+const SliderRange = () => {
    const { rootClass, value } = React.useContext(SliderContext);

-    return <div className={`${rootClass}-range`} style={{ left: `calc(${value}% - 16px)`, width: `calc(${value}%)` }}>{children}</div>;
+    return <div className={`${rootClass}-range`} style={{ left: `calc(${value}% - 16px)`, width: `calc(${value}%)` }} />;
};
src/components/ui/Slider/fragments/SliderThumb.tsx (1)

3-3: Fix unused import warning.

The linting warning about useRef being unused is a false positive since you're using React.useRef directly. Update the import to fix this warning.

-import React, { useRef } from 'react';
+import React from 'react';
src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (1)

38-47: Enhance keyboard handling robustness.

The keyboard handling logic works but could be improved for better reliability and error handling.

             onKeyDownCapture={(e) => {
                 if (e.key === 'Enter') {
                     e.preventDefault();
-                    const itemValue = refs.floating.current.querySelector('[data-active="true"]');
+                    const itemValue = refs.floating.current?.querySelector('[data-active="true"]');
                   
                     if (itemValue) {
-                        handleSelect((itemValue.getAttribute('data-value')))
+                        const value = itemValue.getAttribute('data-value');
+                        if (value) {
+                            handleSelect(value);
+                        }
                     }
                 }
             }}
src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (1)

57-57: Remove console.log statements.

Debug console.log statements should be removed from production code.

-            console.log('arrow input taken');
-    console.log('activeItemValue', activeItemValue);

Also applies to: 81-81

src/components/ui/Checkbox/stories/Checkbox.stories.tsx (2)

11-13: Consider extracting the SVG icon for better maintainability.

The inline SVG implementation is correct but could be improved for maintainability. Consider extracting the TickIcon to a shared icons directory or constants file if it's used elsewhere in the codebase.

-const TickIcon = () => {
-    return <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>;
-};
+const TickIcon = () => (
+    <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
+        <path 
+            d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" 
+            fill="currentColor" 
+            fillRule="evenodd" 
+            clipRule="evenodd"
+        />
+    </svg>
+);

15-23: Consider removing unnecessary wrapper div.

The CheckboxStory component structure is correct and demonstrates the compound component pattern well. However, the outer div wrapper appears unnecessary and could be removed for cleaner markup.

const CheckboxStory = () => {
-    return <div>
-        <Checkbox.Root>
-            <Checkbox.Indicator>
-                <TickIcon />
-            </Checkbox.Indicator>
-        </Checkbox.Root>
-    </div>;
+    return (
+        <Checkbox.Root>
+            <Checkbox.Indicator>
+                <TickIcon />
+            </Checkbox.Indicator>
+        </Checkbox.Root>
+    );
};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ffe90f and 30142b6.

📒 Files selected for processing (35)
  • docs/app/docs/layout.tsx (1 hunks)
  • docs/components/layout/Documentation/helpers/CodeBlock.js (3 hunks)
  • src/components/ui/Checkbox/Checkbox.tsx (1 hunks)
  • src/components/ui/Checkbox/context/CheckboxContext.tsx (1 hunks)
  • src/components/ui/Checkbox/fragments/CheckboxIndicator.tsx (1 hunks)
  • src/components/ui/Checkbox/fragments/CheckboxRoot.tsx (1 hunks)
  • src/components/ui/Checkbox/stories/Checkbox.stories.tsx (1 hunks)
  • src/components/ui/Select/Select.tsx (2 hunks)
  • src/components/ui/Select/fragments/SelectSearch.tsx (1 hunks)
  • src/components/ui/Select/stories/Select.stories.tsx (1 hunks)
  • src/components/ui/Slider/Slider.tsx (1 hunks)
  • src/components/ui/Slider/context/SliderContext.tsx (1 hunks)
  • src/components/ui/Slider/fragments/SliderRange.tsx (1 hunks)
  • src/components/ui/Slider/fragments/SliderRoot.tsx (1 hunks)
  • src/components/ui/Slider/fragments/SliderThumb.tsx (1 hunks)
  • src/components/ui/Slider/fragments/SliderTrack.tsx (1 hunks)
  • src/components/ui/Slider/stories/Slider.stories.tsx (1 hunks)
  • src/core/primitives/Checkbox/context/CheckboxPrimitiveContext.tsx (1 hunks)
  • src/core/primitives/Checkbox/fragments/CheckboxPrimitiveIndicator.tsx (1 hunks)
  • src/core/primitives/Checkbox/fragments/CheckboxPrimitiveRoot.tsx (1 hunks)
  • src/core/primitives/Checkbox/fragments/CheckboxPrimitiveTrigger.tsx (1 hunks)
  • src/core/primitives/Checkbox/index.tsx (1 hunks)
  • src/core/primitives/Checkbox/stories/CheckboxPrimitive.stories.tsx (1 hunks)
  • src/core/primitives/Select/Select.tsx (2 hunks)
  • src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx (1 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (2 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveItem.tsx (2 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx (4 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (1 hunks)
  • src/core/primitives/Select/stories/Select.stories.tsx (1 hunks)
  • styles/jsTokens/colors.tokens.js (1 hunks)
  • styles/themes/components/checkbox.scss (1 hunks)
  • styles/themes/components/select.scss (2 hunks)
  • styles/themes/components/slider.scss (1 hunks)
  • styles/themes/default.scss (2 hunks)
✅ Files skipped from review due to trivial changes (16)
  • docs/app/docs/layout.tsx
  • src/core/primitives/Checkbox/context/CheckboxPrimitiveContext.tsx
  • src/components/ui/Checkbox/context/CheckboxContext.tsx
  • styles/themes/default.scss
  • src/components/ui/Select/Select.tsx
  • src/core/primitives/Select/Select.tsx
  • src/components/ui/Slider/fragments/SliderTrack.tsx
  • src/core/primitives/Checkbox/index.tsx
  • styles/themes/components/slider.scss
  • styles/themes/components/checkbox.scss
  • src/components/ui/Slider/Slider.tsx
  • src/components/ui/Checkbox/fragments/CheckboxRoot.tsx
  • src/components/ui/Slider/context/SliderContext.tsx
  • src/components/ui/Slider/stories/Slider.stories.tsx
  • src/core/primitives/Checkbox/stories/CheckboxPrimitive.stories.tsx
  • styles/jsTokens/colors.tokens.js
🧰 Additional context used
🧠 Learnings (18)
📓 Common learnings
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/components/ui/Select/stories/Select.stories.tsx (2)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The `Dropdown.Trigger` component is customizable and needs to be used with `Dropdown.Root`.
src/core/primitives/Checkbox/fragments/CheckboxPrimitiveIndicator.tsx (2)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/components/ui/Checkbox/fragments/CheckboxIndicator.tsx (2)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/components/ui/Checkbox/Checkbox.tsx (3)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The `Dropdown.Trigger` component is customizable and needs to be used with `Dropdown.Root`.
src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (2)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/core/primitives/Checkbox/fragments/CheckboxPrimitiveTrigger.tsx (3)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The `Dropdown.Trigger` component is customizable and needs to be used with `Dropdown.Root`.
src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx (1)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx (3)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: kotAPI
PR: rad-ui/ui#1031
File: src/components/ui/Accordion/fragments/AccordionRoot.tsx:41-44
Timestamp: 2025-04-07T04:38:34.864Z
Learning: The Accordion component in rad-ui/ui supports both controlled and uncontrolled modes through props like `value`, `defaultValue`, and `onValueChange`. When implementing controlled components, remember to: 1) Initialize state from defaultValue, 2) Update internal state when value changes (controlled mode), 3) Call onValueChange callback, and 4) Prevent internal state updates when in controlled mode.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The `Dropdown.Trigger` component is customizable and needs to be used with `Dropdown.Root`.
styles/themes/components/select.scss (1)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/components/ui/Slider/fragments/SliderThumb.tsx (1)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/core/primitives/Checkbox/fragments/CheckboxPrimitiveRoot.tsx (3)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The `Dropdown.Trigger` component is customizable and needs to be used with `Dropdown.Root`.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/components/ui/Checkbox/stories/Checkbox.stories.tsx (2)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
Learnt from: kotAPI
PR: rad-ui/ui#484
File: src/components/ui/Kbd/stories/Kbd.stories.js:6-6
Timestamp: 2024-10-27T07:20:10.457Z
Learning: In the Storybook files, variations in the title prefixes like 'Components/', 'WIP/', 'Tools/', and 'Examples/' are intentional. These naming patterns are acceptable and should not be flagged as inconsistencies in future code reviews.
src/core/primitives/Select/fragments/SelectPrimitiveItem.tsx (3)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
Learnt from: kotAPI
PR: rad-ui/ui#1031
File: src/components/ui/Accordion/fragments/AccordionRoot.tsx:41-44
Timestamp: 2025-04-07T04:38:34.864Z
Learning: The Accordion component in rad-ui/ui supports both controlled and uncontrolled modes through props like `value`, `defaultValue`, and `onValueChange`. When implementing controlled components, remember to: 1) Initialize state from defaultValue, 2) Update internal state when value changes (controlled mode), 3) Call onValueChange callback, and 4) Prevent internal state updates when in controlled mode.
src/core/primitives/Select/stories/Select.stories.tsx (1)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
docs/components/layout/Documentation/helpers/CodeBlock.js (2)
Learnt from: GoldGroove06
PR: rad-ui/ui#889
File: docs/app/docsv2/components/aspect-ratio/docs/codeUsage.js:16-17
Timestamp: 2025-02-22T18:53:12.639Z
Learning: The code object in docs/app/docsv2/components/aspect-ratio/docs/codeUsage.js requires two closing braces - one for the inner `javascript` object and another for the outer `code` object.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (2)
Learnt from: kotAPI
PR: rad-ui/ui#576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the `TogglePrimitive` component (`src/core/primitives/Toggle/index.tsx`), when the component becomes controlled, it's acceptable to not sync the internal `isPressed` state with the external `pressed` prop.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/components/ui/Slider/fragments/SliderRoot.tsx (2)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The `Dropdown.Trigger` component is customizable and needs to be used with `Dropdown.Root`.
Learnt from: kotAPI
PR: rad-ui/ui#1031
File: src/components/ui/Accordion/fragments/AccordionRoot.tsx:41-44
Timestamp: 2025-04-07T04:38:34.864Z
Learning: The Accordion component in rad-ui/ui supports both controlled and uncontrolled modes through props like `value`, `defaultValue`, and `onValueChange`. When implementing controlled components, remember to: 1) Initialize state from defaultValue, 2) Update internal state when value changes (controlled mode), 3) Call onValueChange callback, and 4) Prevent internal state updates when in controlled mode.
🧬 Code Graph Analysis (3)
src/components/ui/Select/fragments/SelectSearch.tsx (1)
src/components/ui/Select/contexts/SelectRootContext.tsx (1)
  • SelectRootContext (7-9)
src/components/ui/Slider/fragments/SliderThumb.tsx (1)
src/components/ui/Slider/context/SliderContext.tsx (1)
  • SliderContext (13-21)
src/core/primitives/Select/fragments/SelectPrimitiveItem.tsx (1)
src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx (1)
  • SelectPrimitiveContext (26-26)
🪛 GitHub Actions: Lint
src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx

[warning] 8-8: ESLint: 'selectedItemRef' is assigned a value but never used. (no-unused-vars)

src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx

[warning] 2-2: ESLint: 'useEffect' is defined but never used. (no-unused-vars)

src/components/ui/Slider/fragments/SliderThumb.tsx

[warning] 3-19: ESLint: 'useRef' is defined but never used; jsx-a11y/click-events-have-key-events and jsx-a11y/no-static-element-interactions warnings at line 19.

src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx

[warning] 2-13: ESLint: 'useEffect', 'Primitive', 'setIsOpen', and 'selectedValue' are defined or assigned but never used. (no-unused-vars)

src/components/ui/Slider/fragments/SliderRoot.tsx

[warning] 92-92: ESLint jsx-a11y/click-events-have-key-events and jsx-a11y/no-static-element-interactions: Visible non-interactive elements with click handlers must have keyboard listeners and appropriate roles.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (21)
docs/components/layout/Documentation/helpers/CodeBlock.js (1)

11-12: LGTM: Clean imports for the ScrollArea refactor.

The addition of clsx and ScrollArea imports supports the component modernization effectively.

src/components/ui/Slider/fragments/SliderRoot.tsx (1)

1-97: Inconsistency between PR objectives and actual changes.

The PR objectives mention "Progress bar Sizes" but the files being reviewed are for a Slider component implementation. Please verify if these files are correctly associated with PR #1153.

#!/bin/bash
# Verify if there are any Progress component changes in this PR
echo "Searching for Progress component files..."
fd -t f -e tsx -e ts | grep -i progress | head -10

echo "Searching for any progress-related changes..."
rg -i "progress" --type ts --type tsx -A 3 -B 3 | head -20

Likely an incorrect or invalid review comment.

src/components/ui/Select/stories/Select.stories.tsx (1)

176-176: Clean integration of search functionality.

The addition of <Select.Search/> appropriately demonstrates the new search feature within the story example.

src/components/ui/Select/fragments/SelectSearch.tsx (1)

5-14: Well-structured component implementation.

The SelectSearch component correctly uses the SelectRootContext and follows the established pattern for fragment components in this codebase.

src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx (1)

22-23: Context extension looks correct.

The addition of activeItemValue and setActiveItemValue properties to the context type is properly typed and follows the established pattern.

src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx (3)

27-27: Good addition of active item state.

The activeItemValue state is properly initialized and will be used by the search functionality.


64-73: Appropriate use of useLayoutEffect for DOM measurements.

The switch from useEffect to useLayoutEffect is correct for synchronous DOM measurements and positioning calculations.


75-75: Context values properly extended.

The context values correctly include the new activeItemValue and setActiveItemValue for the search functionality.

src/core/primitives/Select/stories/Select.stories.tsx (1)

145-175: PR objectives don't match the actual changes.

The PR objectives mention "Progress bar Sizes" but all the code changes are about adding search functionality to the Select component. Please verify that this is the correct PR and update the objectives accordingly.

Likely an incorrect or invalid review comment.

styles/themes/components/select.scss (2)

85-108: LGTM! Well-structured search input styling.

The search input styles are well-implemented with:

  • Consistent use of CSS custom properties for theming
  • Proper accessibility support with focus states
  • Good user experience with smooth transitions
  • Appropriate box-sizing and responsive behavior

163-167: LGTM! Consistent active item highlighting.

The active item styling appropriately uses the existing accent color scheme and maintains consistency with other item states.

src/core/primitives/Select/fragments/SelectPrimitiveItem.tsx (3)

15-16: LGTM! Proper context consumption and state management.

The addition of activeItemValue to the context consumption and the local isFocused state properly supports the new active item tracking functionality.


18-27: LGTM! Clean focus management implementation.

The focus/blur handlers properly maintain the local focused state which is used for the data-active attribute.


28-37: LGTM! Proper component transition and attribute logic.

The transition from ButtonPrimitive to Primitive.div is clean, and the data-active attribute logic correctly combines both the context's active item value and the local focus state.

src/core/primitives/Checkbox/fragments/CheckboxPrimitiveTrigger.tsx (1)

1-13: Inconsistency: PR objectives mention Progress bar but code implements Checkbox components.

The PR objectives describe "Progress bar Sizes" but all the provided files implement Checkbox components. Please verify that the correct files are being reviewed.

Likely an incorrect or invalid review comment.

src/core/primitives/Checkbox/fragments/CheckboxPrimitiveIndicator.tsx (1)

6-12: Implementation looks correct and follows conditional rendering pattern.

The component correctly uses context to conditionally render the indicator based on the checked state, which is the expected behavior for a checkbox indicator.

src/components/ui/Checkbox/fragments/CheckboxIndicator.tsx (1)

4-8: Component structure follows good composition pattern.

The component correctly wraps the primitive indicator and passes props appropriately, maintaining a clean separation between primitive and UI layers.

src/components/ui/Checkbox/Checkbox.tsx (1)

4-12: Excellent compound component pattern implementation.

The component correctly implements the compound component pattern with clear developer guidance. The warning message helps prevent misuse, and the static property assignment enables clean API usage like Checkbox.Root and Checkbox.Indicator.

src/components/ui/Checkbox/stories/Checkbox.stories.tsx (3)

1-28: Inconsistency between PR objectives and file content.

The PR objectives mention "Progress bar Sizes" and adding different sizes for the progress bar component, but this file is implementing a Checkbox component story. This appears to be unrelated to the stated PR objectives.

Please clarify if this file was included in the PR by mistake or if the PR description needs to be updated to reflect multiple component additions.

Likely an incorrect or invalid review comment.


1-9: LGTM!

The imports and Storybook configuration follow standard patterns. The "Components/" title prefix is appropriate as confirmed by the project's established conventions.


25-27: LGTM!

The Default story export follows proper Storybook patterns and correctly wraps the component in SandboxEditor for interactive functionality.

}
return (
<pre className="relative mb-8">
<div className="relative ">
<code
<div className="relative height maxHeight">
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix invalid CSS class names.

The class string "relative height maxHeight" contains invalid CSS class names. The height and maxHeight appear to be variable names rather than actual CSS classes.

Apply this diff to fix the CSS classes:

-<div className="relative height maxHeight">
+<div className="relative">
🤖 Prompt for AI Agents
In docs/components/layout/Documentation/helpers/CodeBlock.js at line 64, the
className string "relative height maxHeight" incorrectly includes "height" and
"maxHeight" which are not valid CSS class names but likely variable names.
Replace these with appropriate CSS class names or remove them if they are not
CSS classes, ensuring only valid CSS class names are included in the className
attribute.

Comment on lines +75 to +84
<ScrollArea.Root className = { clsx("transition-all", expanded ? "max-h-[640px]": "max-h-[180px]")}>
<ScrollArea.Viewport style={{height: inline ? 'auto' : height, maxHeight: maxHeight, overflowY: 'auto'}}>
<code className={`language-${language} whitespace-pre-wrap block`}>
{code}
</code>
</ScrollArea.Viewport>
<ScrollArea.Scrollbar>
<ScrollArea.Thumb />
</ScrollArea.Scrollbar>
</ScrollArea.Root>
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve the ScrollArea implementation consistency.

The ScrollArea implementation has some inconsistencies with the existing height/maxHeight logic and styling approach:

  1. The height and maxHeight variables are calculated but not used in the ScrollArea classes
  2. Mixing inline styles with conditional classes creates inconsistent styling patterns
  3. The ScrollArea.Viewport inline styles may not align with the component's design system

Apply this diff to improve consistency:

-<ScrollArea.Root className = { clsx("transition-all", expanded ? "max-h-[640px]": "max-h-[180px]")}>
-    <ScrollArea.Viewport style={{height: inline ? 'auto' : height, maxHeight: maxHeight, overflowY: 'auto'}}>
-        <code className={`language-${language} whitespace-pre-wrap block`}> 
-        {code}
-        </code>
-    </ScrollArea.Viewport>
-    <ScrollArea.Scrollbar>
-        <ScrollArea.Thumb />
-    </ScrollArea.Scrollbar>
-</ScrollArea.Root>
+<ScrollArea.Root className={clsx(
+    "transition-all",
+    !inline && (expanded ? "max-h-[640px]" : "max-h-[180px]"),
+    inline && "h-auto"
+)}>
+    <ScrollArea.Viewport className="overflow-auto">
+        <code className={`language-${language} whitespace-pre-wrap block`}>
+            {code}
+        </code>
+    </ScrollArea.Viewport>
+    <ScrollArea.Scrollbar>
+        <ScrollArea.Thumb />
+    </ScrollArea.Scrollbar>
+</ScrollArea.Root>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<ScrollArea.Root className = { clsx("transition-all", expanded ? "max-h-[640px]": "max-h-[180px]")}>
<ScrollArea.Viewport style={{height: inline ? 'auto' : height, maxHeight: maxHeight, overflowY: 'auto'}}>
<code className={`language-${language} whitespace-pre-wrap block`}>
{code}
</code>
</ScrollArea.Viewport>
<ScrollArea.Scrollbar>
<ScrollArea.Thumb />
</ScrollArea.Scrollbar>
</ScrollArea.Root>
<ScrollArea.Root className={clsx(
"transition-all",
!inline && (expanded ? "max-h-[640px]" : "max-h-[180px]"),
inline && "h-auto"
)}>
<ScrollArea.Viewport className="overflow-auto">
<code className={`language-${language} whitespace-pre-wrap block`}>
{code}
</code>
</ScrollArea.Viewport>
<ScrollArea.Scrollbar>
<ScrollArea.Thumb />
</ScrollArea.Scrollbar>
</ScrollArea.Root>
🤖 Prompt for AI Agents
In docs/components/layout/Documentation/helpers/CodeBlock.js around lines 75 to
84, the ScrollArea component inconsistently applies height and maxHeight by
mixing inline styles and conditional classes, and does not use the calculated
height and maxHeight variables in the class names. To fix this, remove the
inline styles on ScrollArea.Viewport and instead apply height and maxHeight
through conditional class names or styles consistent with the design system,
ensuring the calculated height and maxHeight variables are properly used in the
ScrollArea classes for consistent styling.

Comment on lines +15 to +17
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
console.log(e.target.value);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove console.log from production code.

The console.log statement should be removed from production code. Consider using the setValue function from context to properly update the slider value.

 const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
-    console.log(e.target.value);
+    // TODO: Implement proper value update logic using setValue from context
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
console.log(e.target.value);
};
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
- console.log(e.target.value);
+ // TODO: Implement proper value update logic using setValue from context
};
🤖 Prompt for AI Agents
In src/components/ui/Slider/fragments/SliderThumb.tsx around lines 15 to 17,
remove the console.log statement from the handleChange function to avoid logging
in production. Instead, use the setValue function from the context to update the
slider value properly when the input changes.

Comment on lines +19 to +22
return <div className={`${rootClass}-thumb`} onClick={handleClick} style={{ left: `calc(${value}% - 16px)` }}>
<span className={`${rootClass}-thumb-value`}></span>
<input onChange={handleChange} value={value} style={{ display: 'none' }} ref={sliderInputRef} />
</div>;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add keyboard event handlers for accessibility.

The component has accessibility issues due to missing keyboard event handlers. Interactive elements should support keyboard navigation.

-    return <div className={`${rootClass}-thumb`} onClick={handleClick} style={{ left: `calc(${value}% - 16px)` }}>
+    return <div 
+        className={`${rootClass}-thumb`} 
+        onClick={handleClick}
+        onKeyDown={(e) => {
+            if (e.key === 'Enter' || e.key === ' ') {
+                e.preventDefault();
+                handleClick(e as any);
+            }
+        }}
+        role="slider"
+        tabIndex={0}
+        aria-valuemin={0}
+        aria-valuemax={100}
+        aria-valuenow={value}
+        style={{ left: `calc(${value}% - 16px)` }}
+    >
         <span className={`${rootClass}-thumb-value`}></span>
         <input onChange={handleChange} value={value} style={{ display: 'none' }} ref={sliderInputRef} />
     </div>;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return <div className={`${rootClass}-thumb`} onClick={handleClick} style={{ left: `calc(${value}% - 16px)` }}>
<span className={`${rootClass}-thumb-value`}></span>
<input onChange={handleChange} value={value} style={{ display: 'none' }} ref={sliderInputRef} />
</div>;
return <div
className={`${rootClass}-thumb`}
onClick={handleClick}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleClick(e as any);
}
}}
role="slider"
tabIndex={0}
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={value}
style={{ left: `calc(${value}% - 16px)` }}
>
<span className={`${rootClass}-thumb-value`}></span>
<input
onChange={handleChange}
value={value}
style={{ display: 'none' }}
ref={sliderInputRef}
/>
</div>;
🤖 Prompt for AI Agents
In src/components/ui/Slider/fragments/SliderThumb.tsx around lines 19 to 22, the
div acting as an interactive element lacks keyboard event handlers, causing
accessibility issues. Add appropriate keyboard event handlers such as onKeyDown
to handle key presses like Enter and Space, enabling keyboard navigation and
interaction. Ensure the handlers trigger the same behavior as the onClick event
to maintain consistent functionality for keyboard users.


setSliderValue(e);

console.log('moving');
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove console.log from production code.

Debug console.log statements should be removed from production code.

-        console.log('moving');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.log('moving');
🤖 Prompt for AI Agents
In src/components/ui/Slider/fragments/SliderRoot.tsx at line 88, remove the
console.log('moving') statement to eliminate debug output from production code.

import React from 'react';
import CheckboxPrimitiveIndicator from '~/core/primitives/Checkbox/fragments/CheckboxPrimitiveIndicator';

const CheckboxIndicator = ({ children, className = '', ...props }: CheckboxIndicatorProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Define missing TypeScript interface.

The component references CheckboxIndicatorProps but this type is not defined or imported, which will cause a TypeScript compilation error.

+interface CheckboxIndicatorProps {
+    children: React.ReactNode;
+    className?: string;
+}
+
 const CheckboxIndicator = ({ children, className = '', ...props }: CheckboxIndicatorProps) => (
🤖 Prompt for AI Agents
In src/components/ui/Checkbox/fragments/CheckboxIndicator.tsx at line 4, the
type CheckboxIndicatorProps is used but not defined or imported, causing a
TypeScript error. Define the CheckboxIndicatorProps interface to specify the
expected props for the CheckboxIndicator component, including children and
className, or import it if it exists elsewhere. This will resolve the missing
type reference and ensure proper type checking.

<CheckboxPrimitiveTrigger className={className}>
{children}
</CheckboxPrimitiveTrigger>
<input type="checkbox" style={{ display: 'none' }} />
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Connect hidden input to component state and add proper attributes.

The hidden input should be synchronized with the component's checked state and include proper form attributes.

-        <input type="checkbox" style={{ display: 'none' }} />
+        <input 
+            type="checkbox" 
+            checked={checked}
+            onChange={() => {}} // Controlled by trigger
+            style={{ display: 'none' }}
+            tabIndex={-1}
+            aria-hidden="true"
+        />

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/core/primitives/Checkbox/fragments/CheckboxPrimitiveRoot.tsx at line 19,
the hidden input element is not connected to the component's checked state and
lacks necessary form attributes. Update the input to have its checked attribute
bound to the component's state, add an onChange handler to update the state, and
include relevant attributes like name and id to ensure proper form behavior and
accessibility.

Comment on lines +10 to +13
const contextValues = {
checked,
setChecked
};
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Optimize context value creation to prevent unnecessary re-renders.

The context values object is recreated on every render, which can cause performance issues in child components.

-    const contextValues = {
-        checked,
-        setChecked
-    };
+    const handleCheckedChange = React.useCallback((newChecked: boolean) => {
+        if (controlledChecked === undefined) {
+            setInternalChecked(newChecked);
+        }
+        onCheckedChange?.(newChecked);
+    }, [controlledChecked, onCheckedChange]);
+
+    const contextValues = React.useMemo(() => ({
+        checked,
+        setChecked: handleCheckedChange
+    }), [checked, handleCheckedChange]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const contextValues = {
checked,
setChecked
};
const handleCheckedChange = React.useCallback((newChecked: boolean) => {
if (controlledChecked === undefined) {
setInternalChecked(newChecked);
}
onCheckedChange?.(newChecked);
}, [controlledChecked, onCheckedChange]);
const contextValues = React.useMemo(() => ({
checked,
setChecked: handleCheckedChange
}), [checked, handleCheckedChange]);
🤖 Prompt for AI Agents
In src/core/primitives/Checkbox/fragments/CheckboxPrimitiveRoot.tsx around lines
10 to 13, the contextValues object is recreated on every render causing
unnecessary re-renders in child components. To fix this, memoize the
contextValues object using React's useMemo hook, specifying checked and
setChecked as dependencies, so the object is only recreated when these values
change.

import CheckboxPrimitiveContext from '../context/CheckboxPrimitiveContext';
import CheckboxPrimitiveTrigger from './CheckboxPrimitiveTrigger';

const CheckboxPrimitiveRoot = ({ children, className = '' }: { children: React.ReactNode, className?: string }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add support for controlled component pattern.

The component should support both controlled and uncontrolled usage patterns with checked, defaultChecked, and onCheckedChange props.

+interface CheckboxPrimitiveRootProps {
+    children: React.ReactNode;
+    className?: string;
+    checked?: boolean;
+    defaultChecked?: boolean;
+    onCheckedChange?: (checked: boolean) => void;
+}
+
-const CheckboxPrimitiveRoot = ({ children, className = '' }: { children: React.ReactNode, className?: string }) => {
+const CheckboxPrimitiveRoot = ({ 
+    children, 
+    className = '', 
+    checked: controlledChecked, 
+    defaultChecked = false, 
+    onCheckedChange 
+}: CheckboxPrimitiveRootProps) => {

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/core/primitives/Checkbox/fragments/CheckboxPrimitiveRoot.tsx at line 7,
the CheckboxPrimitiveRoot component currently only accepts children and
className props and does not support controlled usage. Modify the component to
accept checked, defaultChecked, and onCheckedChange props to enable both
controlled and uncontrolled usage patterns. Implement internal state management
for uncontrolled mode and use the checked prop for controlled mode, calling
onCheckedChange when the checked state changes.

import CheckboxPrimitiveTrigger from './CheckboxPrimitiveTrigger';

const CheckboxPrimitiveRoot = ({ children, className = '' }: { children: React.ReactNode, className?: string }) => {
const [checked, setChecked] = React.useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Initialize state with defaultChecked value.

The state should be initialized with the defaultChecked value when provided.

-    const [checked, setChecked] = React.useState(false);
+    const [internalChecked, setInternalChecked] = React.useState(defaultChecked);
+    const checked = controlledChecked !== undefined ? controlledChecked : internalChecked;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [checked, setChecked] = React.useState(false);
const [internalChecked, setInternalChecked] = React.useState(defaultChecked);
const checked = controlledChecked !== undefined ? controlledChecked : internalChecked;
🤖 Prompt for AI Agents
In src/core/primitives/Checkbox/fragments/CheckboxPrimitiveRoot.tsx at line 8,
the state variable 'checked' is initialized with a fixed value 'false'. Update
the initialization to use the 'defaultChecked' prop value if it is provided, so
the initial state reflects the default checked status passed to the component.

lint does not recognize @each in scss
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.

4 participants