Skip to content

Chore/enable corepack GitHub actions #75

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

Closed
wants to merge 89 commits into from

Conversation

Harman-singh-waraich
Copy link
Contributor

@Harman-singh-waraich Harman-singh-waraich commented Apr 15, 2025

⚠️ Testing actions


PR-Codex overview

This PR focuses on significant refactoring and improvements to the codebase, including the removal of outdated files, enhancements to components, and updates to styling and configurations for better maintainability and functionality.

Detailed summary

  • Removed obsolete configuration and type definition files.
  • Updated component implementations to use utility functions for styling.
  • Introduced new components and storybook stories for better UI representation.
  • Enhanced TypeScript types and linting configurations.
  • Improved accessibility and responsiveness in components.

The following files were skipped due to too many changes: src/stories/text-area.stories.tsx, src/stories/number-field.stories.tsx, src/lib/dropdown/select/simple-button.tsx, src/lib/tag/index.tsx, src/lib/progress/timeline/index.tsx, src/lib/display/icon.tsx, src/lib/form/datepicker/time-control.tsx, src/lib/dropdown/select/dropdown-button.tsx, src/lib/form/datepicker/arrow-button.tsx, src/stories/dropdown-cascader.stories.tsx, src/stories/radioGroup.stories.tsx, src/lib/dropdown/cascader/item.tsx, src/lib/progress/steps/bullet.tsx, src/stories/dropdown-select.stories.tsx, eslint.config.mjs, src/lib/copiable/index.tsx, src/lib/form/switch.tsx, src/lib/progress/steps/bullet-circle.tsx, src/lib/form/slider.tsx, src/lib/progress/timeline/spine.tsx, src/lib/form/searchbar.tsx, src/lib/accordion/accordion-item.tsx, src/lib/form/datepicker/calendar.tsx, src/lib/breadcrumb.tsx, src/stories/custom-timeline.stories.tsx, src/lib/form/datepicker/display-button.tsx, src/lib/form/radio-group.tsx, src/stories/bignumber-field.stories.tsx, src/lib/button/index.tsx, src/lib/form/text-area.tsx, src/lib/form/checkbox.tsx, src/lib/form/text-field.tsx, src/lib/progress/steps/horizontal-bullet.tsx, src/lib/dropdown/select/index.tsx, src/lib/progress/circular/index.tsx, src/lib/dropdown/cascader/dropdown-container.tsx, src/lib/messages/push.tsx, src/lib/pagination/compact.tsx, src/lib/messages/alert.tsx, src/lib/progress/linear/index.tsx, package.json, src/lib/form/number-field.tsx, src/lib/dropdown/cascader/index.tsx, src/lib/pagination/standard.tsx, src/lib/form/bignumber-field/index.tsx, src/lib/form/datepicker/index.tsx, src/lib/pagination/tabs.tsx, src/lib/progress/timeline/bullet.tsx, src/styles/theme.css, README.md, src/lib/tooltip/index.tsx, src/lib/form/file-uploader.tsx, src/stories/KlerosUIComponentsLibrary.mdx, src/lib/form/bignumber-field/useBigNumberField.tsx, yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Introduced new and improved UI components, including enhanced form fields (NumberField, BigNumberField, TextField, TextArea), accessible dropdowns, sliders, and progress indicators.
    • Added comprehensive Storybook documentation and interactive stories for all components.
    • Integrated global theming with light/dark mode support and utility-first CSS styling via Tailwind CSS.
    • Provided new accessibility features and ARIA support across components.
  • Refactor

    • Migrated all component styling from styled-components to Tailwind CSS utility classes.
    • Replaced custom stateful logic with react-aria-components for accessibility and consistency.
    • Simplified and unified component APIs and props for easier usage.
  • Bug Fixes

    • Improved accessibility and keyboard navigation for interactive components.
    • Enhanced form validation and error messaging.
  • Chores

    • Updated build system from Parcel to Vite for faster builds and better module support.
    • Modernized ESLint, Prettier, and Tailwind CSS configurations.
    • Cleaned up and removed deprecated files, old themes, and unused code.
  • Documentation

    • Expanded and restructured README with detailed usage, development, and contribution guidelines.
    • Added Storybook MDX landing page and categorized documentation for easier onboarding.
  • Style

    • Introduced consistent global typography, color schemes, and custom scrollbar styles.
    • Improved visual appearance and responsiveness across all components.
  • Tests

    • Added Storybook stories to visually test and demonstrate all UI components.

Harman-singh-waraich and others added 30 commits March 7, 2025 17:42
feat: migrate to vite and add storybook
Copy link
Contributor

coderabbitai bot commented Apr 15, 2025

Walkthrough

This update is a comprehensive refactor and modernization of the Kleros UI Components Library. It removes all usage of styled-components and theme JS objects, replacing them with utility-first CSS via Tailwind, custom global CSS, and React Aria components for accessibility and composability. All form, navigation, layout, and interactive components are rewritten to use accessible primitives and utility classes. The build system is migrated from Parcel to Vite, and Storybook is upgraded with new stories and configuration. Numerous configuration and example files are deleted, and the documentation is fully rewritten. The codebase now leverages TypeScript, Tailwind CSS, and modern React best practices.

Changes

File(s) / Path(s) Change Summary
.babelrc, .eslintrc.json, .parcelrc, .lintstagedrc.json, .gitignore, .prettierrc, .storybook/*, .github/workflows/*, eslint.config.mjs, tsconfig.json, vite.config.ts, vite.config.theme.ts, package.json Removed or replaced configuration files for Babel, ESLint, Parcel, lint-staged, and gitignore; added Prettier config with Tailwind plugin; introduced Storybook and Vite configs; updated package scripts and dependencies for Vite, Tailwind, Storybook, and modern tooling.
README.md Completely rewritten and expanded documentation covering usage, development, publishing, contributing, and licensing.
src/examples/*, src/App.tsx Deleted all example/demo components and the old app entry point.
src/global.d.ts, src/styles/global.css, src/styles/theme.css, src/lib/theme.ts Added new global CSS, theme CSS, and SVG import typings; removed old global style and theme JS files.
src/lib/* (all components) Refactored all components to remove styled-components and theme JS; rewrote with Tailwind utility classes, new global CSS, and React Aria primitives; updated props, signatures, and accessibility.
src/lib/form/* Replaced all form controls with new implementations using React Aria components and utility CSS; introduced new fields (NumberField, BigNumberField, TextField, TextArea), and removed old Field, Textarea, and related styled-components.
src/lib/dropdown/* Rewrote dropdowns and cascaders to use React Aria Select, Popover, ListBox, and Tree components; removed custom state and styled-components; introduced new item and button components.
src/lib/button/* Replaced styled-components buttons with a unified Button component using React Aria and utility classes; added new ButtonIcon, ButtonText, and KlerosSymbol components.
src/lib/container/* Rewrote Box, Card, Modal components to use utility classes and React Aria (for Modal).
src/lib/progress/*, src/lib/pagination/*, src/lib/messages/*, src/lib/tag/*, src/lib/tooltip/* Refactored all progress, pagination, message, tag, and tooltip components to use utility CSS and React Aria where applicable; improved accessibility and flexibility.
src/lib/index.ts Updated exports to new field, textarea, and radio components; removed theme exports and added global CSS import.
src/utils/index.ts Added utility functions for class name merging (cn) and undefined checks.
src/stories/* Added comprehensive Storybook stories for all components, with controls, docs, and preview arguments.
src/styles/common-style.ts, src/styles/global-style.ts, src/styles/themes.ts Deleted all styled-components CSS helpers, global styles, and theme JS objects.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UIComponent
  participant ReactAria
  participant TailwindCSS
  participant GlobalCSS

  User->>UIComponent: Interacts with component (e.g., Button, Form)
  UIComponent->>ReactAria: Delegates accessibility, state, and ARIA roles
  UIComponent->>TailwindCSS: Applies utility classes for styling
  UIComponent->>GlobalCSS: Inherits global theme variables and base styles
  ReactAria-->>UIComponent: Provides accessible behavior and state
  TailwindCSS-->>UIComponent: Resolves class names and applies styles
  GlobalCSS-->>UIComponent: Applies theme colors, typography, and transitions
  UIComponent-->>User: Renders accessible, themed UI
Loading

Possibly related PRs

  • kleros/ui-components-library#54: Refactors the Checkbox component, which is also fully rewritten in this PR, making both changes directly related at the file and component level.
  • kleros/ui-components-library#73: Deletes .eslintrc.json and adds Prettier config, overlapping with this PR's removal of the same ESLint config and similar linting setup changes.
  • kleros/ui-components-library#69: Migrates button components from styled-components to React Aria and utility CSS, directly overlapping with the button refactor and file deletions in this PR.

Poem

Oh, what a leap for our UI crew,
From styled-components we say adieu!
With Tailwind’s breeze and Aria’s might,
Our buttons and forms now shine so bright.
Storybook’s tales, new themes in tow,
Vite builds fast, and docs now flow.
🐇 Hopping forward, CSS in our fur—
This rabbit’s proud of how things occur!

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • 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 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 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 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 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 or @coderabbitai title 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.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

🧹 Nitpick comments (47)
src/stories/utils.tsx (1)

1-6: Type alias is correct, but consider deduplicating with .storybook/preview.tsx.

The IPreviewArgs type is well-structured for Storybook controls. However, a nearly identical type exists in .storybook/preview.tsx. To avoid future inconsistencies, consider defining this type in a single location and importing it where needed.

src/stories/copiable.stories.tsx (1)

1-44: The Copiable stories are well-structured and demonstrate both icon placement options.

The file effectively sets up two story variants showing different icon placements (right and left), with appropriate controls and preview arguments. The structure follows Storybook best practices with proper TypeScript typing.

There's a minor inconsistency in the info text: one has a period at the end (line 30) while the other doesn't (line 41).

  info: "Copy this text",

to

  info: "Copy this text.",

for consistency between story variants.

src/styles/global.css (1)

35-42: Avoid using !important in CSS rules

Using !important in CSS rules can lead to specificity issues and make future styling changes more difficult. Consider refactoring these hover effects to use more specific selectors or a different approach that doesn't require !important.

.hover-medium-blue:hover {
-  background-color: var(--klerosUIComponentsMediumBlue) !important;
+  background-color: var(--klerosUIComponentsMediumBlue);
}

.hover-white-background:hover {
-  background-color: var(--klerosUIComponentsWhiteBackground) !important;
+  background-color: var(--klerosUIComponentsWhiteBackground);
}
src/lib/container/modal.tsx (1)

14-17: Avoid hardcoded dimensions for flexible components

The Modal component has hardcoded dimensions (h-[200px] w-[328px]), which limits its flexibility for different use cases. Consider making the dimensions configurable via props or removing these constraints to allow for more flexible usage.

<AriaModal
  className={cn(
-   "bg-klerosUIComponentsWhiteBackground h-[200px] w-[328px]",
+   "bg-klerosUIComponentsWhiteBackground",
    "rounded-base box-border",
    className,
  )}
>

This allows the consumer to control the dimensions through the className prop, making the component more reusable.

src/lib/form/datepicker/calendar.tsx (2)

74-76: Consider more flexible weekday abbreviation handling

The current implementation hardcodes weekday abbreviations to the first two characters, which might not be ideal for all languages and locales.

-            {day.substring(0, 2)}
+            {day.substring(0, 
+              // Some languages need more than 2 chars for meaningful abbreviations
+              locale?.startsWith('zh') || locale?.startsWith('ja') ? 1 : 2
+            )}

101-101: Consider using a more flexible date formatting approach

The current implementation manually formats day numbers with zero-padding. Consider using a proper date formatting utility for better localization support.

-            {date.day.toString().length === 1 ? `0${date.day}` : date.day}
+            {new Intl.NumberFormat(locale, { minimumIntegerDigits: 2 }).format(date.day)}
vite.config.ts (2)

5-6: Consider resolving ESLint warning properly

The ESLint disable comment suggests an issue with the import resolution. Consider fixing the underlying issue rather than disabling the ESLint rule.

If the Tailwind import is causing issues, ensure it's properly installed and configured in your project dependencies:

npm install @tailwindcss/vite --save-dev

Also make sure your tsconfig.json includes the path in its module resolution.


13-14: Ensure consistent module format configuration

The configuration specifies only ES modules format (formats: ["es"]), but later includes UMD globals configuration. If UMD is actually needed, consider adding it to the formats array.

-      formats: ["es"],
+      formats: ["es", "umd"],
src/stories/circular-progress.stories.tsx (2)

34-67: Consider adding JSDoc comments for all stories

There's a JSDoc comment for the NonAnimated story but not for the others. Consider adding descriptive comments for all stories to maintain consistency and improve documentation.

+/** Default circular progress component with 50% completion. */
 export const Default: Story = {
   args: {
     themeUI: "dark",
     backgroundUI: "light",
     value: 50,
   },
 };
 
+/** Shows a fully completed circular progress (100%). */
 export const Completed: Story = {
   args: {
     themeUI: "dark",
     backgroundUI: "light",
     value: 100,
   },
 };
 
+/** Smaller variant of the circular progress component. */
 export const Small: Story = {
   args: {
     themeUI: "dark",
     backgroundUI: "light",
     value: 70,
     small: true,
   },
 };

32-32: Consider documenting the IPreviewArgs interface

The Story type extends IPreviewArgs, but there's no explanation of what this interface contains. Consider adding a comment or TypeScript reference to clarify its purpose and structure.

-type Story = StoryObj<typeof meta> & IPreviewArgs;
+/** 
+ * Story type with additional preview arguments for theme and background.
+ * IPreviewArgs contains themeUI and backgroundUI properties.
+ */
+type Story = StoryObj<typeof meta> & IPreviewArgs;
src/lib/container/box.tsx (2)

7-11: Consider making dimensions customizable

The Box component has hardcoded dimensions (h-[200px] w-[328px]) which limits its flexibility. Consider making these customizable through props to allow for different size variations.

- "bg-klerosUIComponentsMediumBlue h-[200px] w-[328px]",
+ "bg-klerosUIComponentsMediumBlue",
+ className,
- className,

Then document the expected classes for sizing in a comment or README.


4-16: Add typedoc comments for the component

This component lacks documentation. Consider adding JSDoc/TSDoc comments to describe the component's purpose and usage.

+/**
+ * A basic container component with rounded corners and blue background.
+ * @param className - Additional CSS classes to apply
+ * @param props - Standard HTML div attributes
+ */
function Box({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
src/lib/accordion/custom.tsx (1)

22-25: Consider making width responsive or customizable

The hardcoded width of 1000px makes the accordion less flexible for different viewports and use cases. Consider making this responsive or allowing it to be overridden through props.

- "box-border flex w-[1000px] flex-col"
+ "box-border flex w-full max-w-[1000px] flex-col"
src/lib/scrollbar.tsx (1)

6-24: Effective refactoring to functional component with utility classes

The component has been nicely refactored from styled-components to a functional component using Tailwind utility classes. The implementation correctly spreads props to SimpleBar and properly composes classNames using the cn utility.

The complex Tailwind class selectors target SimpleBar's internal elements effectively, but consider extracting these to constants or a configuration object to improve readability:

+const scrollbarClasses = {
+  scrollbar: "[&_.simplebar-scrollbar]:before:!bg-klerosUIComponentsPrimaryBlue",
+  visible: "[&_.simplebar-visible]:before:!opacity-100",
+  mask: "[&_.simplebar-mask]:!bg-klerosUIComponentsWhiteBackground",
+};

function Scrollbar({
  children,
  className,
  ...props
}: React.ComponentProps<typeof SimpleBar>) {
  return (
    <SimpleBar
      className={cn(
-       "[&_.simplebar-scrollbar]:before:!bg-klerosUIComponentsPrimaryBlue",
-       "[&_.simplebar-visible]:before:!opacity-100",
-       "[&_.simplebar-mask]:!bg-klerosUIComponentsWhiteBackground",
+       scrollbarClasses.scrollbar,
+       scrollbarClasses.visible,
+       scrollbarClasses.mask,
        className,
      )}
      {...props}
    >
      {children}
    </SimpleBar>
  );
}
src/lib/dropdown/select/simple-button.tsx (1)

69-69: Consider removing trailing space character.

There's a trailing space character after the Arrow component {" "}. While this might be intentional for spacing, it's generally better to handle spacing with CSS.

-          />{" "}
+          />
src/stories/custom-timeline.stories.tsx (1)

110-149: Missing explicit alignment variation in the TimelineAlignment story.

While the story is named "TimelineAlignment" and has a comment about changing alignment for individual steps, the actual implementation doesn't show different alignment settings for the steps. Both items appear to use the default alignment.

Consider adding explicit alignment properties to demonstrate the variation, for example:

{
  title: "Pay 250 DAI",
  party: (...),
  subtitle: "06 Jul 2023 12:00 UTC",
  variant: "#4D00B4",
  Icon: Circle,
+ rightSided: true,
},
{
  title: "Jury Decision - Round 1",
  party: "No",
  subtitle: "06 Jul 2023 12:00 UTC",
  variant: "#ca2314",
  state: "loading",
+ rightSided: false,
},
src/lib/progress/steps/horizontal-bullet.tsx (1)

75-86: Consider using optional chaining for cleaner conditional rendering.

The current implementation works correctly, but could be simplified with optional chaining.

-{subitems &&
-  subitems.map((item, i) => (
+{subitems?.map((item, i) => (

Also, aria-description is not a standard ARIA attribute. Consider using aria-describedby instead.

-              aria-description={`subitem ${i + 1}`}
+              aria-describedby={`horizontal-step-${index}-subitem-${i}`}
🧰 Tools
🪛 Biome (1.9.4)

[error] 75-85: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/lib/container/card.tsx (1)

4-7: Consider adding default values for booleans.
Currently, round and hover default to false. To clarify intent, you can either rely on the implicit undefined check or define explicit defaults via ES6 default parameters.

src/lib/form/bignumber-field/index.tsx (1)

13-18: Interface extends well.
Extending BigNumberFieldProps while adding variant, message, Icon, and className provides clarity. Consider documenting default behavior for variant when it’s unset.

src/lib/form/checkbox.tsx (1)

10-12: Inline label approach.
Requiring a label as a string ensures the checkbox is accessible. Consider an optional render-prop or ReactNode if richer labeling is needed.

src/lib/progress/timeline/index.tsx (1)

41-51: Usage of h-[unset], grow-0, and basis-auto is logically consistent.
It effectively customizes the last bullet’s size constraints without affecting earlier items. If needed, consider a small comment explaining the custom h-[unset] style for clarity.

src/stories/text-field.stories.tsx (2)

15-35: Consider adding an error variant story.
You've defined a variant prop supporting "success", "warning", "error", and "info," but there isn't a dedicated story showcasing the error variant behavior. Including an error story variant would mirror the existing success demo and help users see how the text field handles invalid inputs or error states.


80-102: Form-based required story is beneficial.
The form submission handling illustrates how required fields can be validated and integrated.

If you plan to add real validation logic here, you could show an error message if the field is left empty upon submission.

src/lib/display/icon.tsx (1)

22-45: Accessible, flexible structure.
Using multiple nested Card components for layout, providing ARIA labeling, and merging custom classes with cn help ensure both composability and accessibility.

If you anticipate further variation (e.g., vertical layout, bigger icon sizes), consider accepting layout-related props or passing a custom wrapper rather than stacking nested Card components.

src/lib/form/datepicker/display-button.tsx (1)

44-55: Appropriate dynamic icon coloring on focus.
This ensures visual feedback for keyboard or screen reader users.

Consider describing the icon in a visually hidden label or title attribute for fully non-visual contexts.

src/lib/form/text-field.tsx (2)

41-41: Consider allowing more flexible width configuration.

The component has a fixed width of 278px which might limit reusability in different contexts. Consider making the width more configurable either through additional props or by letting container styles determine the width.

-  className={cn("flex w-[278px] flex-col", className)}
+  className={cn("flex w-full flex-col", className)}

79-90: Add keyboard accessibility attributes to icon container

While the aria-hidden="true" attribute is correct for decorative elements, since this container appears to be interactive, consider adding keyboard focus management attributes if the icon is meant to be interactive.

src/styles/theme.css (1)

72-223: Consider adding section comments for better maintainability.

This theme file provides a comprehensive set of CSS custom properties, but lacks documentation. Consider adding comments to explain the purpose of different sections for better maintainability.

src/lib/dropdown/cascader/item.tsx (2)

52-65: Use a more semantically appropriate element than label.

The label element is typically used for form controls, but here it's being used to display the children count. Consider using a span or div element instead for better semantic HTML.

-              <label
+              <span
                 className={cn(
                   "border-klerosUIComponentsStroke ease-ease size-6 rounded-full border transition",
                   "flex items-center justify-center",
                   "text-klerosUIComponentsStroke text-sm",
                   isHovered &&
                     "border-klerosUIComponentsPrimaryBlue text-klerosUIComponentsPrimaryBlue cursor-pointer",
                   isSelected &&
                     "border-klerosUIComponentsPrimaryBlue text-klerosUIComponentsPrimaryBlue",
                   isDisabled && "cursor-not-allowed",
                 )}
               >
                 {children.length}
-              </label>
+              </span>

51-51: Simplify conditional check for children.

The condition checks both children and children?.length > 0, which is redundant. If children is truthy, there's no need to use optional chaining to check its length.

-            {children && children?.length > 0 && (
+            {children && children.length > 0 && (
src/lib/dropdown/select/item.tsx (2)

16-16: Consider using a more specific type instead of any.

The itemValue property is typed as any, which reduces type safety. Consider using a more specific type or a generic parameter to improve type checking.

-  itemValue?: any;
+  itemValue?: string | number | boolean | object;

41-42: Simplify icon rendering logic.

The current implementation uses nullish coalescing with a nested condition, which is slightly hard to read. Consider simplifying this logic for better readability.

-          {icon ??
-            (Icon && <Icon className="max-h-4 min-h-3 max-w-4 min-w-3" />)}
+          {icon || (Icon && <Icon className="max-h-4 min-h-3 max-w-4 min-w-3" />)}
src/stories/bignumber-field.stories.tsx (1)

156-162: Rename "Error" story to avoid shadowing global Error object.

The name "Error" shadows the global Error constructor, which could lead to confusion.

-export const Error: Story = {
+export const ErrorState: Story = {
  args: {
    ...Default.args,
    variant: "error",
    message: "Invalid amount",
  },
};
🧰 Tools
🪛 Biome (1.9.4)

[error] 156-156: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

src/stories/dropdown-cascader.stories.tsx (1)

75-90: Add JSDoc comments for consistency

The DefaultValueSelected story is missing JSDoc comments while some other stories have them. Consider adding them to all stories for consistent documentation.

+/** Dropdown Cascader with a default key selected. */
export const DefaultValueSelected: Story = {
  args: {
    ...DropdownCascader.args,
    defaultSelectedKey: 1,
  },
};
src/lib/progress/timeline/spine.tsx (1)

5-5: Consider using a regular expression literal instead of the RegExp constructor

Regular expression literals are generally preferred as they avoid some escaping requirements and are easier to analyze statically.

-export const colorRegex = new RegExp("^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$");
+export const colorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
🧰 Tools
🪛 Biome (1.9.4)

[error] 5-5: Use a regular expression literal instead of the RegExp constructor.

Regular expression literals avoid some escaping required in a string literal, and are easier to analyze statically.
Safe fix: Use a literal notation instead.

(lint/complexity/useRegexLiterals)

README.md (3)

90-90: Minor grammar fix needed.
Replace “If want to override or edit” with “If you want to override or edit…”

- If want to override or edit the defined theme variables, you can do so like this:
+ If you want to override or edit the defined theme variables, you can do so like this:

185-185: Refine “feel free to” wording.
Consider adopting more concise and direct phrasing to maintain a professional tone.

- Contributions are welcome! Please feel free to submit a Pull Request.
+ Contributions are welcome! Please submit a Pull Request.
🧰 Tools
🪛 LanguageTool

[style] ~185-~185: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...ontributing Contributions are welcome! Please feel free to submit a Pull Request. 1. Fork the rep...

(FEEL_FREE_TO_STYLE_ME)


189-189: Avoid using “amazing.”
A more professional term can help maintain a consistent tone.

- git commit -m 'feat: add some amazing feature'
+ git commit -m 'feat: add some impressive feature'
🧰 Tools
🪛 LanguageTool

[style] ~189-~189: Consider using a more formal and expressive alternative to ‘amazing’.
Context: ...our changes using conventional commits (git commit -m 'feat: add some amazing feature') 4. Push to the branch (`git ...

(AWESOME)

src/lib/button/index.tsx (1)

37-85: Consider destructuring small for consistency.

Using props.small in line 59 is functional but less consistent than directly destructuring small alongside variant, isLoading, etc. This slight refactor can simplify the code and enhance readability.

-function Button({
+function Button({ 
+  small,
   className,
   isDisabled,
   ...props
 }: Readonly<ButtonProps>): React.ReactElement {
   return (
     <AriaButton
-      className={cn(
-        props.small ? "px-6 py-1.5" : "px-8 py-[11.5px]",
+      className={cn(
+        small ? "px-6 py-1.5" : "px-8 py-[11.5px]",
         ...
       )}
     >
src/lib/breadcrumb.tsx (2)

2-4: Consider consolidating imports.
Using both cn (which internally relies on clsx) and direct clsx imports is slightly redundant. You could unify them to simplify import statements.

2 import { cn } from "../utils";
3-import { Button } from "react-aria-components";
4-import { clsx } from "clsx";
+import { Button } from "react-aria-components";
// remove direct clsx usage if not needed

31-35: Use a stable key for mapping breadcrumb items.
Currently, key={i} in the mapped items can lead to unexpected behavior if items are re-ordered. Consider using a stable unique property (e.g., value) if possible.

- {items.map(({ text, value }, i) =>
-   i === items.length - 1 ? (
+ {items.map(({ text, value }, index) =>
+   index === items.length - 1 ? (
      ...
-       key={i}
+       key={value}
      ...

Also applies to: 36-37, 38-77

src/lib/dropdown/cascader/dropdown-container.tsx (1)

46-59: Magic number for column width.
The 239 used to compute scrolling might be unclear to future maintainers. Consider storing it in a named constant to improve readability.

48-      const columnWidth = 239; // 238 + 1 for column gap
+      const COLUMN_WIDTH_PX = 239; // 238 + 1 for column gap
+      
-      const target = columnWidth * (level + 1);
+      const target = COLUMN_WIDTH_PX * (level + 1);
src/lib/form/datepicker/index.tsx (1)

76-85: Consider clarity for "Clear" button behavior.
Currently, pressing "Clear" resets to the defaultValue. If truly clearing the picker to an empty state is desired, consider setting state.setValue(null) or a similar approach.

src/lib/form/bignumber-field/useBigNumberField.tsx (1)

357-613: ARIA attributes and event handlers.
Handling focus, blur, keyboard arrows, Home/End, and wheel events thoroughly addresses accessibility and usability.

Consider strongly typing the returned ARIA props in getAriaAttributes for additional type safety.

src/lib/tooltip/index.tsx (1)

49-60: Potential overshadowing of props.tooltipProps.className
Currently, the code doesn't incorporate props.tooltipProps.className into the combined className prop. If you wish to allow users to pass custom classes via props.tooltipProps.className, consider merging it via cn(...) to avoid overshadowing.

src/lib/tag/index.tsx (1)

14-36: Optimize semantic usage
Consider replacing the <p> tag with a <span> to ensure textual content is semantically inline inside the Button.

src/lib/pagination/tabs.tsx (1)

17-37: Consider using a stricter type than any for value
Relying on any can reduce type safety. Consider making TabsItem generic or using a union type if applicable.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c66afa7 and e8e026e.

⛔ Files ignored due to path filters (7)
  • src/stories/assets/addon-library.png is excluded by !**/*.png
  • src/stories/assets/cover.png is excluded by !**/*.png
  • src/stories/assets/figma.png is excluded by !**/*.png
  • src/stories/assets/file.png is excluded by !**/*.png
  • src/stories/assets/github.png is excluded by !**/*.png
  • src/stories/assets/tutorials.svg is excluded by !**/*.svg
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (172)
  • .babelrc (0 hunks)
  • .eslintrc.json (0 hunks)
  • .github/workflows/eslint.yml (1 hunks)
  • .github/workflows/tsc.yml (1 hunks)
  • .gitignore (1 hunks)
  • .lintstagedrc.json (1 hunks)
  • .parcelrc (0 hunks)
  • .prettierrc (1 hunks)
  • .storybook/main.ts (1 hunks)
  • .storybook/preview.tsx (1 hunks)
  • README.md (1 hunks)
  • eslint.config.mjs (1 hunks)
  • global.d.ts (0 hunks)
  • index.html (1 hunks)
  • package.json (1 hunks)
  • src/App.tsx (0 hunks)
  • src/examples/accordion.tsx (0 hunks)
  • src/examples/buttons.tsx (0 hunks)
  • src/examples/containers.tsx (0 hunks)
  • src/examples/copiable.tsx (0 hunks)
  • src/examples/displays.tsx (0 hunks)
  • src/examples/dropdowns.tsx (0 hunks)
  • src/examples/form.tsx (0 hunks)
  • src/examples/input.tsx (0 hunks)
  • src/examples/messages.tsx (0 hunks)
  • src/examples/pagination.tsx (0 hunks)
  • src/examples/progress.tsx (0 hunks)
  • src/examples/timeline.tsx (0 hunks)
  • src/examples/tooltip.tsx (0 hunks)
  • src/global.d.ts (1 hunks)
  • src/hooks/pagination/use-pagination.tsx (2 hunks)
  • src/hooks/use-focus-outside.tsx (1 hunks)
  • src/hooks/useElementSize.ts (1 hunks)
  • src/hooks/useResizeObserver.ts (1 hunks)
  • src/lib/accordion/accordion-item.tsx (2 hunks)
  • src/lib/accordion/custom.tsx (3 hunks)
  • src/lib/accordion/index.tsx (3 hunks)
  • src/lib/breadcrumb.tsx (1 hunks)
  • src/lib/button/ButtonIcon.tsx (1 hunks)
  • src/lib/button/ButtonText.tsx (1 hunks)
  • src/lib/button/KlerosSymbol.tsx (1 hunks)
  • src/lib/button/base.tsx (0 hunks)
  • src/lib/button/index.tsx (1 hunks)
  • src/lib/button/primary.tsx (0 hunks)
  • src/lib/button/secondary.tsx (0 hunks)
  • src/lib/button/tertiary.tsx (0 hunks)
  • src/lib/container/box.tsx (1 hunks)
  • src/lib/container/card.tsx (1 hunks)
  • src/lib/container/modal.tsx (1 hunks)
  • src/lib/copiable/index.tsx (3 hunks)
  • src/lib/display/icon.tsx (1 hunks)
  • src/lib/display/large.tsx (1 hunks)
  • src/lib/display/small.tsx (1 hunks)
  • src/lib/dot.tsx (1 hunks)
  • src/lib/dropdown/base-item-container.tsx (0 hunks)
  • src/lib/dropdown/base-item.tsx (0 hunks)
  • src/lib/dropdown/button.tsx (0 hunks)
  • src/lib/dropdown/cascader/button.tsx (1 hunks)
  • src/lib/dropdown/cascader/dropdown-container.tsx (1 hunks)
  • src/lib/dropdown/cascader/index.tsx (1 hunks)
  • src/lib/dropdown/cascader/item-container.tsx (0 hunks)
  • src/lib/dropdown/cascader/item.tsx (1 hunks)
  • src/lib/dropdown/cascader/select-button.tsx (1 hunks)
  • src/lib/dropdown/cascader/selector.tsx (0 hunks)
  • src/lib/dropdown/dropdown-container.tsx (0 hunks)
  • src/lib/dropdown/select/button.tsx (0 hunks)
  • src/lib/dropdown/select/dropdown-button.tsx (1 hunks)
  • src/lib/dropdown/select/dropdown-container.tsx (1 hunks)
  • src/lib/dropdown/select/index.tsx (1 hunks)
  • src/lib/dropdown/select/item-container.tsx (0 hunks)
  • src/lib/dropdown/select/item.tsx (1 hunks)
  • src/lib/dropdown/select/simple-button.tsx (1 hunks)
  • src/lib/dropdown/simple-button.tsx (0 hunks)
  • src/lib/form/bignumber-field/index.tsx (1 hunks)
  • src/lib/form/bignumber-field/useBigNumberField.tsx (1 hunks)
  • src/lib/form/checkbox.tsx (1 hunks)
  • src/lib/form/datepicker/arrow-button.tsx (1 hunks)
  • src/lib/form/datepicker/calendar.tsx (1 hunks)
  • src/lib/form/datepicker/date-selector.tsx (0 hunks)
  • src/lib/form/datepicker/datepickerContext.ts (0 hunks)
  • src/lib/form/datepicker/day.tsx (0 hunks)
  • src/lib/form/datepicker/display-button.tsx (1 hunks)
  • src/lib/form/datepicker/dropdown.tsx (0 hunks)
  • src/lib/form/datepicker/index.tsx (1 hunks)
  • src/lib/form/datepicker/month-selector.tsx (0 hunks)
  • src/lib/form/datepicker/month.tsx (0 hunks)
  • src/lib/form/datepicker/time-control.tsx (1 hunks)
  • src/lib/form/datepicker/time-controls.tsx (0 hunks)
  • src/lib/form/datepicker/time-selector.tsx (0 hunks)
  • src/lib/form/field.tsx (0 hunks)
  • src/lib/form/file-uploader.tsx (1 hunks)
  • src/lib/form/index.tsx (1 hunks)
  • src/lib/form/number-field.tsx (1 hunks)
  • src/lib/form/radio-group.tsx (1 hunks)
  • src/lib/form/radio.tsx (0 hunks)
  • src/lib/form/searchbar.tsx (1 hunks)
  • src/lib/form/slider.tsx (1 hunks)
  • src/lib/form/slider/handle.tsx (0 hunks)
  • src/lib/form/slider/index.tsx (0 hunks)
  • src/lib/form/switch.tsx (1 hunks)
  • src/lib/form/text-area.tsx (1 hunks)
  • src/lib/form/text-field.tsx (1 hunks)
  • src/lib/form/textarea.tsx (0 hunks)
  • src/lib/index.ts (2 hunks)
  • src/lib/messages/alert.tsx (1 hunks)
  • src/lib/messages/push.tsx (1 hunks)
  • src/lib/pagination/compact.tsx (1 hunks)
  • src/lib/pagination/standard.tsx (2 hunks)
  • src/lib/pagination/tabs.tsx (1 hunks)
  • src/lib/progress/circular/index.tsx (2 hunks)
  • src/lib/progress/linear/index.tsx (1 hunks)
  • src/lib/progress/steps/bullet-circle.tsx (2 hunks)
  • src/lib/progress/steps/bullet.tsx (3 hunks)
  • src/lib/progress/steps/horizontal-bullet.tsx (2 hunks)
  • src/lib/progress/steps/horizontal.tsx (2 hunks)
  • src/lib/progress/steps/index.tsx (1 hunks)
  • src/lib/progress/steps/vertical.tsx (2 hunks)
  • src/lib/progress/timeline/bullet.tsx (2 hunks)
  • src/lib/progress/timeline/custom.tsx (1 hunks)
  • src/lib/progress/timeline/index.tsx (1 hunks)
  • src/lib/progress/timeline/spine.tsx (2 hunks)
  • src/lib/scrollbar.tsx (1 hunks)
  • src/lib/tag/index.tsx (1 hunks)
  • src/lib/theme.ts (1 hunks)
  • src/lib/tooltip/index.tsx (1 hunks)
  • src/stories/KlerosUIComponentsLibrary.mdx (1 hunks)
  • src/stories/accordion.stories.tsx (1 hunks)
  • src/stories/alert.stories.tsx (1 hunks)
  • src/stories/bignumber-field.stories.tsx (1 hunks)
  • src/stories/box.stories.tsx (1 hunks)
  • src/stories/breadcrumb.stories.tsx (1 hunks)
  • src/stories/button.stories.tsx (1 hunks)
  • src/stories/card.stories.tsx (1 hunks)
  • src/stories/checkbox.stories.tsx (1 hunks)
  • src/stories/circular-progress.stories.tsx (1 hunks)
  • src/stories/compactPagination.stories.tsx (1 hunks)
  • src/stories/copiable.stories.tsx (1 hunks)
  • src/stories/custom-timeline.stories.tsx (1 hunks)
  • src/stories/datepicker.stories.tsx (1 hunks)
  • src/stories/displayIcon.stories.tsx (1 hunks)
  • src/stories/displayLarge.stories.tsx (1 hunks)
  • src/stories/displaySmall.stories.tsx (1 hunks)
  • src/stories/dropdown-cascader.stories.tsx (1 hunks)
  • src/stories/dropdown-select.stories.tsx (1 hunks)
  • src/stories/fileuploader.stories.tsx (1 hunks)
  • src/stories/form.stories.tsx (1 hunks)
  • src/stories/linear-progress.stories.tsx (1 hunks)
  • src/stories/modal.stories.tsx (1 hunks)
  • src/stories/number-field.stories.tsx (1 hunks)
  • src/stories/push.stories.tsx (1 hunks)
  • src/stories/radioGroup.stories.tsx (1 hunks)
  • src/stories/searchbar.stories.tsx (1 hunks)
  • src/stories/slider.stories.tsx (1 hunks)
  • src/stories/standardPagination.stories.tsx (1 hunks)
  • src/stories/steps.stories.tsx (1 hunks)
  • src/stories/switch.stories.tsx (1 hunks)
  • src/stories/tabs.stories.tsx (1 hunks)
  • src/stories/tag.stories.tsx (1 hunks)
  • src/stories/text-area.stories.tsx (1 hunks)
  • src/stories/text-field.stories.tsx (1 hunks)
  • src/stories/timeline.stories.tsx (1 hunks)
  • src/stories/tooltip.stories.tsx (1 hunks)
  • src/stories/utils.tsx (1 hunks)
  • src/styles/common-style.ts (0 hunks)
  • src/styles/global-style.ts (0 hunks)
  • src/styles/global.css (1 hunks)
  • src/styles/theme.css (1 hunks)
  • src/styles/themes.ts (0 hunks)
  • src/utils/index.ts (1 hunks)
  • tsconfig.json (1 hunks)
  • vite.config.theme.ts (1 hunks)
  • vite.config.ts (1 hunks)
💤 Files with no reviewable changes (47)
  • .babelrc
  • src/lib/button/tertiary.tsx
  • src/examples/accordion.tsx
  • src/examples/containers.tsx
  • global.d.ts
  • src/examples/progress.tsx
  • src/examples/displays.tsx
  • src/lib/dropdown/base-item-container.tsx
  • .parcelrc
  • src/lib/form/slider/handle.tsx
  • src/lib/button/primary.tsx
  • src/examples/copiable.tsx
  • src/styles/global-style.ts
  • src/lib/button/secondary.tsx
  • src/lib/dropdown/cascader/selector.tsx
  • src/lib/form/datepicker/datepickerContext.ts
  • src/examples/buttons.tsx
  • src/examples/dropdowns.tsx
  • src/lib/dropdown/dropdown-container.tsx
  • src/lib/dropdown/select/button.tsx
  • src/lib/form/radio.tsx
  • src/lib/form/datepicker/dropdown.tsx
  • src/styles/themes.ts
  • src/App.tsx
  • src/examples/timeline.tsx
  • src/lib/dropdown/base-item.tsx
  • src/lib/form/textarea.tsx
  • src/lib/dropdown/button.tsx
  • src/lib/dropdown/select/item-container.tsx
  • src/lib/button/base.tsx
  • src/examples/tooltip.tsx
  • src/examples/pagination.tsx
  • src/examples/input.tsx
  • src/lib/form/datepicker/month-selector.tsx
  • src/lib/form/slider/index.tsx
  • src/lib/form/datepicker/time-controls.tsx
  • src/lib/dropdown/simple-button.tsx
  • .eslintrc.json
  • src/lib/form/datepicker/date-selector.tsx
  • src/lib/form/datepicker/day.tsx
  • src/lib/form/datepicker/month.tsx
  • src/lib/form/field.tsx
  • src/lib/form/datepicker/time-selector.tsx
  • src/examples/messages.tsx
  • src/lib/dropdown/cascader/item-container.tsx
  • src/examples/form.tsx
  • src/styles/common-style.ts
🧰 Additional context used
🧬 Code Graph Analysis (65)
src/lib/form/index.tsx (1)
src/stories/form.stories.tsx (1)
  • Form (19-44)
src/stories/accordion.stories.tsx (2)
.storybook/preview.tsx (1)
  • IPreviewArgs (8-11)
src/stories/utils.tsx (1)
  • IPreviewArgs (1-6)
src/stories/utils.tsx (1)
.storybook/preview.tsx (1)
  • IPreviewArgs (8-11)
src/lib/button/ButtonIcon.tsx (2)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/dropdown/cascader/select-button.tsx (3)
src/lib/dropdown/cascader/index.tsx (1)
  • IDropdownCascader (14-19)
src/utils/index.ts (1)
  • isUndefined (8-11)
src/lib/dropdown/cascader/item.tsx (1)
  • IItem (7-12)
src/lib/accordion/custom.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/progress/steps/horizontal.tsx (2)
src/lib/progress/steps/index.tsx (1)
  • StepsProps (12-18)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/tooltip.stories.tsx (1)
src/stories/tag.stories.tsx (1)
  • Tag (22-29)
src/lib/form/slider.tsx (2)
src/stories/slider.stories.tsx (1)
  • Slider (22-34)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/number-field.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/datepicker/arrow-button.tsx (2)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/accordion/index.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/button/ButtonText.tsx (2)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/container/box.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/button/KlerosSymbol.tsx (2)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/checkbox.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/searchbar.stories.tsx (1)
src/stories/form.stories.tsx (1)
  • Form (19-44)
src/stories/linear-progress.stories.tsx (1)
src/stories/circular-progress.stories.tsx (2)
  • Default (34-40)
  • NonAnimated (60-67)
src/lib/scrollbar.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/dropdown/select/simple-button.tsx (2)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/dropdown/cascader/button.tsx (2)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/dropdown/cascader/item.tsx (1)
  • IItem (7-12)
src/stories/timeline.stories.tsx (1)
src/stories/custom-timeline.stories.tsx (2)
  • Timeline (19-39)
  • TimelineAlignment (113-149)
src/lib/form/searchbar.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/custom-timeline.stories.tsx (1)
src/stories/timeline.stories.tsx (2)
  • Timeline (17-39)
  • TimelineAlignment (44-66)
src/lib/form/text-area.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/dropdown/select/dropdown-button.tsx (3)
src/lib/dropdown/select/item.tsx (1)
  • IItem (19-23)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/container/modal.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/bignumber-field/index.tsx (2)
src/lib/form/bignumber-field/useBigNumberField.tsx (2)
  • BigNumberFieldProps (31-66)
  • useBigNumberField (80-613)
src/utils/index.ts (1)
  • cn (4-6)
.storybook/preview.tsx (1)
src/stories/utils.tsx (1)
  • IPreviewArgs (1-6)
src/lib/dropdown/select/dropdown-container.tsx (1)
src/lib/dropdown/select/item.tsx (1)
  • IItem (19-23)
src/stories/radioGroup.stories.tsx (1)
src/stories/form.stories.tsx (1)
  • Form (19-44)
src/lib/dropdown/cascader/item.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/dropdown-select.stories.tsx (2)
src/stories/dropdown-cascader.stories.tsx (2)
  • DisabledKeysSelect (84-90)
  • RequiredSelect (93-115)
src/stories/form.stories.tsx (1)
  • Form (19-44)
src/stories/text-area.stories.tsx (3)
src/stories/number-field.stories.tsx (4)
  • Default (42-49)
  • Variant (51-56)
  • Labelled (65-70)
  • Required (80-102)
src/stories/text-field.stories.tsx (4)
  • Default (42-49)
  • Variant (51-56)
  • Labelled (65-70)
  • Required (80-102)
src/stories/form.stories.tsx (1)
  • Form (19-44)
src/lib/form/datepicker/display-button.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/progress/steps/bullet.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/text-field.stories.tsx (3)
src/stories/number-field.stories.tsx (6)
  • Default (42-49)
  • Variant (51-56)
  • CustomIcon (58-63)
  • Labelled (65-70)
  • WithDescription (72-78)
  • Required (80-102)
src/stories/text-area.stories.tsx (4)
  • Default (47-54)
  • Variant (56-61)
  • Labelled (63-68)
  • Required (80-102)
src/stories/form.stories.tsx (1)
  • Form (19-44)
src/lib/dropdown/select/item.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/datepicker/index.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/text-field.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/progress/timeline/spine.tsx (1)
src/utils/index.ts (1)
  • isUndefined (8-11)
src/lib/display/large.tsx (3)
src/stories/displayLarge.stories.tsx (1)
  • DisplayLarge (18-27)
src/lib/display/icon.tsx (1)
  • DisplayIconProps (7-12)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/button/index.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/container/card.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/dropdown-cascader.stories.tsx (2)
src/stories/dropdown-select.stories.tsx (2)
  • DisabledKeysSelect (80-86)
  • RequiredSelect (89-111)
src/stories/form.stories.tsx (1)
  • Form (19-44)
src/lib/breadcrumb.tsx (2)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/breadcrumb.stories.tsx (1)
  • Breadcrumb (26-38)
src/lib/messages/alert.tsx (2)
src/stories/alert.stories.tsx (1)
  • Alert (23-32)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/pagination/compact.tsx (3)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/utils/index.ts (1)
  • cn (4-6)
src/stories/compactPagination.stories.tsx (1)
  • CompactPagination (29-50)
src/lib/progress/timeline/bullet.tsx (2)
src/utils/index.ts (2)
  • cn (4-6)
  • isUndefined (8-11)
src/lib/progress/timeline/spine.tsx (1)
  • colorRegex (5-5)
src/lib/display/icon.tsx (3)
src/stories/displayIcon.stories.tsx (1)
  • DisplayIcon (18-27)
src/stories/card.stories.tsx (1)
  • Card (25-33)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/dot.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/progress/steps/vertical.tsx (2)
src/lib/progress/steps/index.tsx (1)
  • StepsProps (12-18)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/datepicker/calendar.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/radio-group.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/progress/timeline/custom.tsx (3)
src/lib/progress/timeline/bullet.tsx (2)
  • VariantProp (3-3)
  • StateProp (11-13)
src/lib/progress/timeline/spine.tsx (1)
  • VariantProp (7-7)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/progress/linear/index.tsx (1)
src/utils/index.ts (2)
  • cn (4-6)
  • isUndefined (8-11)
src/lib/dropdown/select/index.tsx (2)
src/lib/dropdown/select/item.tsx (1)
  • IItem (19-23)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/messages/push.tsx (2)
src/stories/push.stories.tsx (1)
  • Push (23-34)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/accordion/accordion-item.tsx (1)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/file-uploader.tsx (2)
src/stories/fileuploader.stories.tsx (1)
  • FileUploader (26-33)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/tag/index.tsx (3)
src/lib/button/index.tsx (1)
  • ButtonProps (26-35)
src/stories/tag.stories.tsx (1)
  • Tag (22-29)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/progress/timeline/index.tsx (3)
src/lib/progress/timeline/bullet.tsx (2)
  • SideProp (7-9)
  • VariantProp (3-3)
src/lib/progress/timeline/spine.tsx (1)
  • VariantProp (7-7)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/dropdown/cascader/dropdown-container.tsx (3)
src/lib/dropdown/cascader/index.tsx (1)
  • IDropdownCascader (14-19)
src/lib/dropdown/cascader/item.tsx (1)
  • IItem (7-12)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/form/datepicker/time-control.tsx (2)
src/lib/form/datepicker/arrow-button.tsx (1)
  • ArrowButtonProps (13-20)
src/utils/index.ts (1)
  • cn (4-6)
src/lib/pagination/tabs.tsx (2)
src/stories/tabs.stories.tsx (1)
  • Tabs (19-44)
src/utils/index.ts (1)
  • cn (4-6)
🪛 actionlint (1.7.4)
.github/workflows/eslint.yml

9-9: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

.github/workflows/tsc.yml

9-9: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 Biome (1.9.4)
src/styles/global.css

[error] 4-4: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)

src/lib/progress/steps/horizontal-bullet.tsx

[error] 75-85: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/lib/progress/timeline/spine.tsx

[error] 5-5: Use a regular expression literal instead of the RegExp constructor.

Regular expression literals avoid some escaping required in a string literal, and are easier to analyze statically.
Safe fix: Use a literal notation instead.

(lint/complexity/useRegexLiterals)

src/lib/breadcrumb.tsx

[error] 9-9: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

src/stories/bignumber-field.stories.tsx

[error] 156-156: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

src/lib/messages/push.tsx

[error] 16-16: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

🪛 LanguageTool
README.md

[grammar] ~89-~89: It seems that a pronoun is missing.
Context: ...variables here. If want to override or edit the defined th...

(IF_VB)


[style] ~185-~185: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...ontributing Contributions are welcome! Please feel free to submit a Pull Request. 1. Fork the rep...

(FEEL_FREE_TO_STYLE_ME)


[style] ~189-~189: Consider using a more formal and expressive alternative to ‘amazing’.
Context: ...our changes using conventional commits (git commit -m 'feat: add some amazing feature') 4. Push to the branch (`git ...

(AWESOME)

🔇 Additional comments (365)
.prettierrc (1)

1-3: Prettier Tailwind plugin configuration looks good.

This ensures Tailwind CSS classes are consistently formatted. No issues found.

src/hooks/use-focus-outside.tsx (1)

4-4: ESLint directive update is appropriate.

The new rule better matches the intent and updated linting config. No issues.

src/hooks/useElementSize.ts (1)

12-13: Trailing comma and lint cleanup are correct.

These changes are stylistic and align with project standards. No issues found.

src/hooks/useResizeObserver.ts (1)

5-5: Trailing comma addition is correct.

This is a stylistic update for consistency. No issues found.

tsconfig.json (1)

34-37: TypeScript config updates are correct.

Excluding new config files and removing the suppress option improves type safety and build reliability.

src/lib/theme.ts (1)

1-1: Theme entry point is correct and minimal.

This file correctly serves as a CSS entry point for the theme build. No issues found.

.lintstagedrc.json (1)

2-2: Lint-staged configuration is correct.

Automatically fixing lint issues on commit is a best practice. No issues found.

index.html (2)

6-6: Global CSS link is correct.

The stylesheet is correctly linked for global styles.


11-11: Script source update is appropriate.

Switching to an absolute path for the entry script is compatible with Vite and the new project structure.

.gitignore (1)

26-27: Obsolete ignores removed and Storybook log ignore added.

The changes reflect the new build tooling and are correct.

src/hooks/pagination/use-pagination.tsx (4)

6-6: Trailing comma in parameter list is correct.

This improves formatting consistency and has no functional impact.


35-35: Trailing comma in argument list is correct.

This is a stylistic improvement and does not affect logic.


38-38: Trailing comma in argument list is correct.

This is a stylistic improvement and does not affect logic.


41-41: Trailing comma in arrow function parameter is correct.

This is a stylistic improvement and does not affect logic.

.github/workflows/eslint.yml (1)

10-11: Enable Corepack step is a best practice for Yarn/pnpm workflows.

Adding corepack enable before dependency installation ensures the correct package manager version is used, which is especially important for Yarn 2+ and pnpm. This is a solid improvement.

src/global.d.ts (1)

1-4: SVG module declaration is correct and standard.

This enables SVG imports as React components with proper typing, which is best practice for TypeScript + React projects using SVGR or similar tooling.

.github/workflows/tsc.yml (1)

10-11: Enable Corepack step is a best practice for Yarn/pnpm workflows.

Adding corepack enable before dependency installation ensures the correct package manager version is used, which is especially important for Yarn 2+ and pnpm. This is a solid improvement.

vite.config.theme.ts (1)

1-16: Vite theme build configuration is correct and modular.

This configuration cleanly separates theme assets from the main library and follows best practices for Vite library builds.

src/lib/form/index.tsx (1)

1-10: Clean and idiomatic wrapper implementation.

The Form component is a well-typed, minimal wrapper around react-aria-components's Form, with clear documentation and correct prop forwarding.

src/stories/checkbox.stories.tsx (1)

1-30: Well-structured Storybook story.

The Checkbox story is clear, uses appropriate controls, and provides a good example for documentation and testing.

src/utils/index.ts (1)

1-11: Useful and idiomatic utility functions.

Both cn and isUndefined are well-implemented and support the codebase's styling and type safety needs.

src/lib/button/KlerosSymbol.tsx (1)

1-27: Concise and effective icon component.

The KlerosSymbol component is well-implemented, with clear logic for dynamic styling and proper use of utility functions.

src/stories/accordion.stories.tsx (1)

1-42: Clear and effective Accordion story.

The Accordion story is well-structured, demonstrates usage, and supports documentation and testing.

src/stories/displayLarge.stories.tsx (1)

1-27: Well-structured Storybook setup for the LargeDisplayComponent

The story is properly configured with appropriate metadata, type annotations, and default props. The use of the satisfies operator with Meta ensures type safety, and extending the StoryObj with IPreviewArgs correctly integrates theme controls.

src/stories/tooltip.stories.tsx (3)

9-40: Comprehensive metadata configuration with appropriate controls

The argTypes object is well-structured with appropriate control types for each prop, making it easy to test different configurations in the Storybook interface.


46-53: Good implementation of default Tooltip story

The default story provides clear example usage with a Tag component as a trigger and appropriate theme settings.


55-63: Excellent addition of an always-open Tooltip variant

Adding the OpenTooltip variant with isOpen: true demonstrates an important use case and makes it easier to test the appearance without needing to hover.

src/stories/box.stories.tsx (1)

1-23: Clean implementation of Box component story

The story follows consistent patterns with other stories in the codebase, using the same structure for metadata and properly integrating theme controls via IPreviewArgs.

src/stories/tag.stories.tsx (2)

7-16: Well-defined metadata with appropriate controls

The metadata includes proper component reference, title categorization, and autodocs tagging. The argTypes definition with a boolean control for the active prop supports interactive testing.


22-38: Good coverage of component states with two variants

Including both inactive and active tag variants provides comprehensive test coverage for the component's visual states.

src/lib/dot.tsx (1)

1-15: Clean refactoring from styled-components to utility-first CSS

The Dot component has been effectively refactored to use utility classes and the cn helper function, aligning with the library's migration away from styled-components. The component correctly accepts and combines the optional className prop with default utility classes using the cn utility.

src/lib/button/ButtonIcon.tsx (1)

1-25: LGTM: Well-structured Button Icon component with good variant handling

The component effectively handles two types of icon inputs (Icon component or React node), with appropriate conditional styling based on button state. Good use of the cn utility for class name merging.

.storybook/main.ts (1)

15-39: Well-implemented TypeScript configuration for component docs

The prop filter implementation is excellent - it selectively includes props from your codebase and specific React Aria packages while excluding other third-party dependencies. This will result in cleaner and more relevant component documentation.

src/stories/switch.stories.tsx (1)

1-28: Good Switch story implementation with appropriate controls

The story is well-structured with proper typing and controls. The boolean control for the "small" property is appropriate for this component type.

src/stories/push.stories.tsx (2)

11-16: Appropriate variant control configuration

Good choice using a radio control for the variant options, making it clear that only one of the three predefined options can be selected.


23-34: Complete story args with meaningful defaults

The story provides a comprehensive set of default arguments that showcase the component's capabilities. The inclusion of a no-op callback function is a good practice for event handler props.

src/stories/timeline.stories.tsx (1)

1-67: Well-structured Timeline stories with clear alignment demonstration.

The file effectively showcases two variations of the Timeline component. The first displays both items right-aligned, while the second demonstrates mixed alignment (right and left). The JSDoc comment on lines 41-43 provides helpful context about the alignment functionality.

The component props match the expected pattern seen in other timeline stories, with appropriate styling and sample data that clearly illustrates the component's functionality.

src/stories/displayIcon.stories.tsx (1)

1-28: Clean implementation of DisplayIcon story.

The story properly demonstrates the IconDisplayComponent with appropriate props including theme settings, width class, text content, label, and icon. The structure follows the standard pattern used in other display component stories.

src/stories/form.stories.tsx (1)

1-45: Effective Form component demonstration with practical example.

The story shows a real-world use case of the FormComponent with a TextField and submit Button. The implementation includes:

  1. Proper form submission handling with preventDefault
  2. Required email field with appropriate placeholder
  3. Submit button with the correct type attribute
  4. Flexible layout using utility classes

This example provides developers with a clear pattern for implementing forms using the component library.

src/lib/button/ButtonText.tsx (1)

1-24: Clean implementation with good conditional styling

The ButtonText component is well-structured and follows good React patterns. It properly handles different states (loading, disabled) and variants with appropriate conditional styling using the cn utility function.

src/stories/displaySmall.stories.tsx (1)

1-27: Well-structured Storybook story

The implementation follows Storybook best practices with clear metadata, proper typing with the IPreviewArgs interface, and comprehensive default props for the story.

src/lib/progress/steps/index.tsx (3)

5-10: Great addition of JSDoc comments to improve documentation!

Adding JSDoc comments to the StepItem interface properties enhances code clarity and developer experience. This makes the component's API more self-documenting.


12-18: Good enhancement of the StepsProps interface

Adding the className prop and JSDoc comment for the horizontal property improves component flexibility and documentation. The className prop aligns with the project's shift toward utility-first CSS approach.


19-22: Nice refactoring to a named function with default prop value

The refactoring from an arrow function to a named function declaration with a default value for horizontal is a good practice. The added JSDoc comment also enhances code documentation.

vite.config.ts (1)

9-43: Overall Vite configuration looks solid

The configuration sets up a proper build for the React component library with appropriate plugins and settings. The structure follows Vite's recommended patterns.

src/stories/circular-progress.stories.tsx (1)

7-28: Well-structured Storybook meta configuration

The meta configuration is well-structured with appropriate controls for the component's props. This makes the Storybook documentation interactive and useful.

src/lib/progress/steps/horizontal.tsx (2)

14-14: Verify custom width class compatibility

The class w-62.5 appears to be a custom width class (equal to 250px based on the summary). Ensure this class is properly defined in your Tailwind configuration, or consider using standard Tailwind width classes for better maintainability.

- "box-border flex w-62.5 items-start justify-center",
+ "box-border flex w-[250px] items-start justify-center",

18-20: Great accessibility improvements!

The addition of aria attributes (aria-orientation, role, aria-label) improves the component's accessibility. This is a valuable enhancement.

src/lib/accordion/custom.tsx (1)

10-13: Good addition of className prop

Adding the optional className property to the AccordionProps interface allows for more flexible styling from external components, which is a good practice.

src/stories/tabs.stories.tsx (1)

1-44: Well-structured Storybook story with comprehensive feature coverage.

The Tabs story effectively demonstrates the component's key features, including default selected tab, icon integration, and disabled state handling. Good use of TypeScript with proper typing and the satisfies operator.

src/stories/alert.stories.tsx (1)

1-32: Clean and well-structured Alert story with appropriate controls.

The Alert story properly demonstrates the component with a warning variant and sets up radio controls for all available variants. Good TypeScript integration and prop configuration.

src/stories/card.stories.tsx (1)

1-33: Well-configured Card story with appropriate boolean controls.

The Card story is properly set up with boolean controls for hover and round properties, allowing for interactive testing of these features. Good use of theme configuration and TypeScript typing.

src/lib/progress/steps/vertical.tsx (5)

4-4: Good use of utility function for class name composition.

The import and use of the cn utility function allows for proper merging of Tailwind classes with any passed className prop.


6-10: Properly updated component signature to handle className prop.

The component now correctly destructures and utilizes the className prop, allowing for external styling customization.


13-18: Excellent accessibility improvements with proper ARIA attributes.

The refactoring adds important accessibility attributes (aria-orientation, role, aria-label) that improve the component's usability for assistive technologies. The Tailwind classes maintain the visual styling while removing the dependency on styled-components.


19-30: Well-structured container for bullet items.

The flex container properly organizes all bullets except the last one, maintaining the original design while using Tailwind's utility classes.


31-38: Proper handling of the last bullet with specific styling.

The last bullet is correctly rendered with specific classes to control its layout behavior, ensuring it doesn't grow but maintains its base size.

src/lib/accordion/index.tsx (4)

3-3: Good addition of utility function import.

The cn utility function import enables proper class name composition with Tailwind CSS, allowing for clean merging of default and custom className props.


15-15: Well-implemented extensibility with className prop.

Adding the optional className prop to AccordionProps interface allows for external styling customization, which is a best practice for reusable components.


21-21: Good conversion to Tailwind classes.

The styled component has been properly replaced with Tailwind utility classes for text styling and layout, maintaining the original design while eliminating the need for styled-components.


33-36: Excellent implementation of container with Tailwind.

The styled wrapper has been effectively replaced with a standard div using Tailwind classes. The cn utility function properly merges the default styling with any custom className passed as a prop, ensuring both consistency and flexibility.

src/stories/datepicker.stories.tsx (5)

1-7: Good structure and imports for Storybook story.

The imports are well organized, bringing in necessary Storybook types, utility components, and the Datepicker component. The internationalized date utilities are appropriate for handling date operations.


8-20: Well-defined Storybook metadata.

The metadata correctly sets up the component, title, tags, and argTypes. The use of satisfies Meta<typeof DatepickerComponent> provides good type checking.


21-29: Clear story definition with appropriate theme settings.

The base story is well configured with dark theme, light background, and appropriate className for full width display.


31-38: Good variant showing time selection capability.

This story variant properly demonstrates the time selection feature by setting the time prop to true while maintaining consistent styling with the base story.


40-49: Excellent demonstration of date constraints.

The story variant with minimum date shows a practical use case using the current date/time in the local timezone. The comment adds helpful context for users.

src/lib/dropdown/select/dropdown-container.tsx (5)

1-6: Appropriate imports for dropdown functionality.

The imports include necessary libraries for class management (clsx), React, React Aria components for accessibility, and custom components for scrolling and item rendering.


7-10: Clear component interface definition.

The component properly defines its props with TypeScript types, accepting an optional boolean for open state and required items array that follows the IItem interface.


11-21: Well-implemented Popover with conditional styling.

The Popover component uses clsx for conditional class composition, applying appropriate background, border, shadow, and focus styles. The animation classes for entering/exiting states are correctly implemented based on the isOpen prop.


22-31: Good implementation of scrollable content with virtualization.

The component properly composes the Scrollbar with ListBox and Collection components, ensuring accessibility and performance with large lists. The grid layout for items is well-defined with appropriate spacing.


32-36: Clean component structure with appropriate exports.

The component structure is clean and follows React best practices for functional components. The default export makes the component easy to import elsewhere.

src/stories/KlerosUIComponentsLibrary.mdx (8)

1-8: Good setup with necessary imports.

The file imports all required Storybook components and assets for the documentation page.


9-25: Well-implemented SVG component for UI consistency.

The RightArrow component is properly defined with appropriate viewBox, dimensions, and styling. Using inline SVG ensures design consistency across the documentation.


27-43: Clear introduction and welcome section.

The documentation starts with a well-structured title and introduction that clearly explains the purpose of the library.


44-95: Comprehensive getting started section with installation instructions.

This section provides clear guidance on installation, CSS import, and component usage with code examples and links to more detailed documentation.


96-138: Well-organized component categories.

The documentation effectively categorizes components into logical groups (form, navigation, interactive, layout) with descriptions and links to detailed documentation.


139-152: Good contribution section with visual appeal.

The contribution section encourages community involvement with a clear call to action and visually appealing design.


153-183: Excellent resource links section.

The social section provides valuable links to GitHub, tutorials, and design resources, making it easy for users to find additional information.


184-406: Well-structured and responsive styling.

The CSS styling is comprehensive and well-organized, with responsive breakpoints for different screen sizes. The card and grid layouts are visually appealing and maintain consistency across the documentation.

src/lib/accordion/accordion-item.tsx (5)

6-7: Appropriate usage of React Aria for accessibility

Good choice using the React Aria Button component to replace styled-components. This improves accessibility and follows modern React practices.


26-35: Well-structured class composition with clear organization

The class names are well organized into logical groups (background/border, hover effects, spacing/padding, layout). The use of the cn utility function for composing class names improves readability.


34-34: React Aria API alignment with onPress

Correct implementation using onPress instead of onClick to align with React Aria's API. This ensures proper handling of keyboard and pointer events.


38-41: Consistent icon styling

Good use of utility classes for icons with appropriate sizing and fill colors.


43-53: Smooth collapsible implementation with proper transitions

The collapsible animation implementation correctly uses the measured height from useElementSize with conditional classes for overflow and transitions. This ensures smooth animations without layout shifts.

src/stories/button.stories.tsx (6)

8-24: Well-structured Storybook configuration

The meta configuration for the Button component is well-organized with appropriate controls for the component props.


29-36: Good primary button story implementation

The PrimaryButton story provides a clear example with appropriate default args.


38-45: Good secondary button story implementation

The SecondaryButton story provides a clear example with appropriate default args.


47-54: Good tertiary button story implementation

The TertiaryButton story provides a clear example with appropriate default args.


56-64: Good icon button story implementation

The IconButton story demonstrates how to use an SVG icon with the button component.


66-74: Good loading button story implementation with disabled state

The LoadingButton story effectively demonstrates both loading and disabled states together.

src/lib/form/slider.tsx (5)

12-20: Well-defined props interface with clear documentation

Good job extending the AriaSliderProps interface and documenting the additional props with JSDoc comments.


31-35: Appropriate callback handling

The component correctly passes the callback to the onChange handler of the AriaSlider.


36-83: Excellent slider implementation with accessible UI

The slider implementation is well-structured with appropriate ARIA labels and state handling. The conditional styling based on disabled state is comprehensive.


49-57: Good implementation of the filled track

The filled portion of the track is correctly styled and sized based on the current value percentage.


84-101: Accessible min/max labels

Good implementation of the min/max labels with appropriate ARIA attributes for accessibility.

src/lib/progress/steps/bullet-circle.tsx (4)

2-2: Migrated from styled-components to clsx utility

Good migration from styled-components to utility classes using clsx for class name composition.


18-21: Clean success icon implementation

The success icon implementation uses appropriate utility classes for size and fill color.


22-42: Well-structured circle implementation with conditional styling

The circle implementation correctly handles the active state with appropriate color changes for background, border, and text.


43-52: Proper vertical line implementation

The connecting line implementation correctly changes color based on the completed state.

src/stories/linear-progress.stories.tsx (1)

1-67: Excellent implementation of Storybook stories for LinearComponent

This well-structured file defines comprehensive stories showcasing the LinearComponent with different configurations. The three variants (Default, NonAnimated, WithTimerLabel) effectively demonstrate the component's capabilities with clear documentation comments that explain the purpose of each variant.

The meta configuration properly defines all controls for the component's customizable properties, making it easy for users to experiment with different values in Storybook.

src/stories/compactPagination.stories.tsx (2)

39-49: Well-implemented state management in Storybook story

Good implementation of React state management with the useState hook to maintain the current page state. This approach allows the pagination component to be interactive within Storybook while preserving the controlled component pattern.


62-73: Well-implemented callback for last page scenario

The addition of onCloseOnLastPage callback demonstrates an important use case for the pagination component. This story effectively shows how the component handles reaching the end of pagination.

src/lib/progress/steps/bullet.tsx (3)

25-31: Great accessibility improvements with ARIA attributes

The refactoring adds critical accessibility attributes to make the component more inclusive. The use of aria-label, role="listitem", aria-current, and aria-disabled significantly improves screen reader compatibility.


38-49: Good semantic HTML with conditional styling

Using an <h2> element for the title improves document structure and semantics. The conditional text color based on active state is well implemented using clsx for cleaner code.


51-62: Enhanced accessibility for subitems

Each subitem now includes proper ARIA attributes that improve screen reader compatibility. The use of aria-label and aria-description provides context for users with assistive technologies.

src/stories/breadcrumb.stories.tsx (2)

11-19: Well-configured control types for component properties

The argTypes configuration uses appropriate control types for each property - radio buttons for the variant selection and a boolean toggle for clickable. This makes the Storybook interface intuitive for users testing the component.


31-35: Good example data structure for breadcrumb items

The example items array shows a clear pattern of how breadcrumb items should be structured with both text and value properties, making it easy for developers to understand the expected data format.

src/stories/slider.stories.tsx (5)

1-6: Well-structured imports with proper TypeScript typing

The import structure is clear, separating Storybook types, utility imports, and component imports with appropriate spacing.


7-16: Well-configured Storybook metadata

The meta configuration is properly typed with satisfies Meta<typeof SliderComponent> and includes appropriate autodocs tags and control settings for the isDisabled property.


20-21: Good type extension for Story

Extending the StoryObj type with the IPreviewArgs interface ensures proper typing for theme and background controls that are defined in the Storybook preview.


22-34: Comprehensive default story configuration

The default Slider story provides a complete set of props including theme settings, disabled state, min/max values, and labels. The empty callback function works for demonstration purposes.


36-42: Well-documented formatter example

The JSDoc comment clearly explains the purpose of the formatter function in the FormattedValueSlider story, and the implementation shows how to properly extend the base story with additional props.

src/stories/radioGroup.stories.tsx (5)

1-9: Clean and organized imports

The imports are well-structured, separating React, Storybook types, utility imports, and component imports with appropriate spacing.


10-32: Comprehensive Storybook metadata with well-defined controls

The meta configuration is properly typed and includes a complete set of controls for all the component's main properties, making it easy to test different configurations in Storybook.


36-49: Well-structured Vertical RadioGroup story

The Vertical story demonstrates the default vertical orientation with appropriate props and test options.


51-63: Properly configured Horizontal RadioGroup story

The Horizontal story effectively demonstrates the horizontal orientation option with the same set of options for easy comparison.


65-76: Clear demonstration of disabled option functionality

The DisabledOptions story shows how to selectively disable individual radio options, which is useful for showcasing this specific capability.

src/lib/scrollbar.tsx (1)

3-4: Proper imports for React and utility functions

The added imports for React and the cn utility function support the component's refactoring from styled-components to utility-based CSS.

.storybook/preview.tsx (4)

1-12: Well-structured theme configuration with proper types

The imports and type definitions are well-organized, properly setting up the theming infrastructure for Storybook. The IPreviewArgs type clearly defines the available theme and background options.


13-34: Effective theme decorator implementation

The decorator implementation is clean and effective, using React's useEffect to toggle the dark mode class on the document root and applying appropriate background classes based on the selected option.


35-48: Proper default args and control configuration

The default arguments and control configurations are well-defined, providing good defaults and appropriate control types for the theme options.


49-54: Clean configuration export

The centered layout parameter and clean export provide a good foundation for all stories in the project.

src/stories/steps.stories.tsx (4)

1-24: Well-structured Storybook configuration for Steps component.

This Storybook configuration effectively sets up interactive controls for the Steps component, allowing testing of both horizontal layout and current step index. The type extension with IPreviewArgs ensures consistency with other stories.


25-38: Good default story implementation with clear props.

The default story provides a comprehensive example with appropriate theme, layout orientation, and an active middle step. The container width ensures proper rendering in the Storybook canvas.


40-47: Effective demonstration of vertical orientation.

This story properly extends the default story and only modifies the necessary props for vertical orientation. The adjustment of container dimensions (height and width) is appropriate for this layout change.


49-59: Good example of hierarchical step structure with subitems.

This story demonstrates the component's flexibility with nested step information, providing a realistic example of how the component might be used in a multi-level workflow.

src/stories/fileuploader.stories.tsx (5)

1-24: Well-organized Storybook setup for FileUploader component.

The meta configuration provides appropriate controls for the component's key properties (variant and isDisabled), enabling interactive testing in Storybook.


26-34: Basic FileUploader story implementation is good.

The story provides essential props including theme, background, width, and a callback placeholder.


35-44: Informative demonstration of FileUploader with message.

This story effectively shows how the component handles informational messages.


45-54: Good variant demonstration with warning state.

This story shows how the component renders in a warning state, which is useful for testing different visual treatments.


56-66: Comprehensive example with file type restrictions.

This story demonstrates the file type restriction feature with PNG images, providing a practical usage example with appropriate informational messaging.

src/lib/form/datepicker/arrow-button.tsx (3)

1-20: Good interface definition and imports for ArrowButton component.

The component properly imports necessary dependencies and defines a clear interface for props. The ArrowButtonProps appropriately extends ButtonProps and includes the specific props needed for this component.


22-47: Well-implemented time handling logic.

The component correctly handles time state with proper initialization and adjustment logic for hours and minutes. The useCallback hook is appropriately used for the event handler with proper dependencies.


48-79: Accessible button implementation with appropriate visual feedback.

The component renders an accessible button with proper aria-label and visual feedback for different states (focus, hover). The arrow rotation based on action type provides clear visual indication of the button's purpose.

src/lib/dropdown/select/dropdown-button.tsx (4)

1-14: Good imports and dependencies setup.

The component imports all necessary dependencies from react-aria-components and includes utility functions for class name management.


15-34: Well-structured ItemDisplayContainer component.

This nested component correctly handles both the placeholder state and selected item rendering with appropriate styling.


36-52: Good button styling with proper state management.

The DropdownButton component applies appropriate styling for various states including hover, focus, and disabled states. The component properly accesses the select state through context.


53-66: Effective rendering of selected value and dropdown indicator.

The component correctly uses SelectValue to render the selected item and provides visual feedback with a rotating arrow to indicate the dropdown state.

src/lib/messages/alert.tsx (3)

6-7: Good addition of utility imports for CSS class composition.

The addition of cn from utils and the clsx library enables efficient composition of conditional class names, aligning with the move toward utility-first CSS.


14-14: LGTM: Optional className prop provides good extensibility.

Adding an optional className prop allows consumers to extend or override default styling, which is a best practice for reusable components.


17-63: Well-structured refactoring from styled-components to utility classes.

The implementation effectively uses Tailwind utility classes with conditional rendering based on variants. The component maintains good accessibility with semantic HTML and proper color contrast.

The use of cn for class merging ensures the external className prop is properly applied, and the grid layout provides consistent spacing between the icon and text.

src/lib/dropdown/cascader/button.tsx (5)

1-11: Good imports and interface usage for component development.

The component properly leverages React Aria components for accessibility and includes the appropriate type imports. The IItem import ensures type safety.


13-18: Component signature follows best practices.

The component is correctly typed as a React FC with ButtonProps extension and an additional optional placeholder prop. The context usage is appropriate for accessing the dropdown state.


19-28: Well-structured Button implementation with utility classes.

The button styling uses appropriate Tailwind classes for colors, transitions, states, and focus management. The spread operator for props allows flexibility while maintaining the core styling.


30-46: Good implementation of dynamic content based on selection state.

The component properly handles placeholder vs. selected states and uses appropriate text styling for each case.


47-53: Nice touch with the rotating arrow icon.

The arrow icon rotation on dropdown open state provides good visual feedback to users. The conditional class application using clsx is well implemented.

src/lib/dropdown/select/simple-button.tsx (3)

7-11: Clear interface definition with appropriate props.

The interface extends ButtonProps and includes specific props for the SimpleButton functionality. The isOpen, small, and placeholder props provide good flexibility.


19-27: Well-structured Button with appropriate base styling.

The Button component is styled with appropriate utility classes for cursor states, focus handling, and basic layout.


28-71: Good use of render props for dynamic styling based on component state.

The component effectively uses the Button render prop to access hover and disabled states, applying appropriate styling conditionally. The small prop toggle between text sizes is well implemented.

src/lib/dropdown/cascader/select-button.tsx (4)

9-12: Well-defined interface that reuses types from parent components.

The interface correctly defines the props needed for this component, reusing the callback type from the parent IDropdownCascader interface.


14-20: Good handling of selected item retrieval from context.

The component correctly uses SelectStateContext and properly handles the case when selectedKey is undefined or null.


21-28: Appropriate container styling with responsive adjustments.

The container div uses proper border and padding classes, with responsive justification that changes between mobile and desktop views.


29-43: Well-implemented button with appropriate state management.

The Button component correctly handles:

  1. Setting the selected key in state
  2. Calling the callback with the selected item
  3. Closing the dropdown
  4. Conditionally rendering text based on selection
  5. Disabling when no selection exists

This provides a complete and accessible user experience.

src/lib/form/datepicker/time-control.tsx (5)

1-9: Well-structured imports and interface definition.

The component imports necessary React components and utilities, and properly defines a typed interface for props.


10-20: Good accessibility implementation with clear component structure.

The component follows best practices by using semantic HTML and proper ARIA attributes. The header section is clearly defined with appropriate styling.


21-30: Clean implementation of the upper arrow controls.

The component uses proper layout and properly passes the minValue prop to the ArrowButton components.


31-56: Well-implemented time display with proper accessibility.

The DateInput implementation correctly filters and displays only hour and minute segments with appropriate styling for focus and hover states. The colon separator is handled elegantly.


57-66: Consistent implementation of lower arrow controls.

The lower section mirrors the upper controls, maintaining consistency in the UI.

src/stories/searchbar.stories.tsx (4)

1-29: Well-structured Storybook configuration with proper typing.

The story setup follows Storybook best practices with proper metadata, controls, and TypeScript typing.


31-37: Clear default story implementation.

The Default story establishes a good baseline with appropriate theme and styling.


39-44: Good pattern of extending the default story.

The Labelled story effectively extends the Default story's args, demonstrating good composition practice.


46-68: Well-implemented form integration example.

The Required story demonstrates proper form integration with the Searchbar component, including:

  • Form submission handling with preventDefault
  • Proper button configuration
  • Correct isRequired prop usage
src/stories/custom-timeline.stories.tsx (4)

1-18: Properly structured Storybook metadata and typing.

The story configuration follows Storybook best practices with appropriate component reference, title, and tags.


19-39: Clear implementation of basic timeline story.

The Timeline story provides a good example of the component's basic usage with appropriate props.


41-70: Good demonstration of different timeline states.

The TimelineStates story effectively showcases the component's different states (default, disabled, loading) with helpful comments.


72-108: Excellent example of custom party content.

The TimelineCustomParty story demonstrates how to use JSX elements for custom party content, including styled text and interactive links.

src/lib/index.ts (3)

1-1: Good practice to import global CSS in the entry point.

Adding the global CSS import ensures styles are properly loaded when the library is used.


17-22: Well-structured form field component exports.

The addition of specialized field components (NumberField, BigNumberField, TextField) improves the API by providing more specific components instead of a generic Field component. The TextArea naming is more consistent with React component naming conventions.


26-26: Updated Radio component path reflects architectural changes.

The change to import from "./form/radio-group" suggests an architectural improvement, likely moving to a more comprehensive radio group implementation with better accessibility.

src/stories/number-field.stories.tsx (2)

1-102: Well-structured Storybook stories with good variation examples

This new file provides comprehensive examples of the NumberField component with various configurations. The stories follow good Storybook practices by:

  • Providing a detailed meta configuration with appropriate controls
  • Showing different variants and states of the component
  • Using TypeScript for proper type safety
  • Demonstrating form integration with the Required story

85-101: Form handling is correctly implemented

The form submission handler properly prevents default behavior with e.preventDefault(), which is essential for Storybook demonstrations to avoid page reloads or unintended form submissions.

src/stories/dropdown-select.stories.tsx (3)

37-51: LGTM: Comprehensive base story configuration

The base story provides a good foundation with default items, placeholder, and callback function. The items array is well-structured with diverse properties that showcase the component's capabilities.


52-86: Good use of story variants with helpful JSDoc comments

The story variants (DefaultValueSelect, SimpleSelect, SmallSimpleSelect, DisabledKeysSelect) effectively demonstrate different component configurations. The JSDoc comments provide helpful context about what each variant demonstrates.


89-111: Form integration matches pattern from other components

The RequiredSelect story follows the same pattern as seen in other form component stories, with proper form submission handling and consistent button styling. This consistency across components is excellent for maintainability.

src/lib/form/searchbar.tsx (3)

3-21: Good use of React Aria components for accessibility

The component properly leverages React Aria components (SearchField, Input, Label, Group) which provides built-in accessibility features. The import structure is clean and well-organized.


14-21: Well-documented props interface with helpful JSDoc

The SearchbarProps interface is clearly defined with appropriate JSDoc comments for the inputProps, including a link to React Spectrum documentation for further reference.


31-62: Clean implementation with good conditional rendering

The component properly handles conditional rendering of the label and uses utility-first CSS effectively. The positioning of the search icon is well-implemented, and the class composition with cn and clsx is clean and maintainable.

src/lib/form/number-field.tsx (3)

22-32: Well-defined props interface with good documentation

The NumberFieldProps interface clearly extends AriaNumberFieldProps with additional properties. The JSDoc comment for inputProps provides helpful reference to the React Spectrum documentation.


57-153: Excellent implementation of input with increment/decrement buttons

The number field implementation follows best practices:

  • Uses render props pattern to access hover state
  • Shows increment/decrement buttons only when hovered and not disabled
  • Properly handles different visual states based on variants
  • Correctly positions icons and buttons with flexible spacing
  • Uses consistent styling patterns with utility classes

154-172: Good handling of message display with variant styling

The message display is well-implemented with:

  • Consistent margin and styling
  • Variant-specific text colors
  • Conditional info icon rendering
  • Proper slot assignment for accessibility
src/lib/form/text-area.tsx (5)

1-16: Well-organized imports with clear separation of concerns.

The imports are logically grouped: React core, SVG assets, react-aria-components, and utilities. This organization makes the code more maintainable.


18-31: Well-defined TypeScript interface with good documentation.

The interface extends TextFieldProps and includes proper JSDoc documentation with links to the React Aria documentation. The props are clearly defined with descriptive comments explaining their purpose, especially for the resize functionality.


33-43: Clean component definition with good default values.

The component includes JSDoc documentation and uses proper TypeScript typing with Readonly<TextAreaProps> to prevent accidental mutations. Default values for resize options are explicitly set to false.


44-75: Accessible implementation with conditional rendering and appropriate class composition.

The component properly uses React Aria components for accessibility, conditionally renders the label, and applies appropriate CSS classes using the cn utility function. The class composition is well-structured, using object syntax for conditional classes based on variants.


76-103: Well-implemented status message with appropriate icons.

The message display includes proper semantic structure using the React Aria Text component with the correct slot="description" attribute. The variant-specific icons and styling are conditionally rendered based on the variant prop.

src/lib/display/small.tsx (3)

4-6: Good addition of utility imports for className management.

The imports of cn and clsx align with the broader refactoring effort from styled-components to utility-first CSS. The Label component from react-aria-components will enhance accessibility.


8-14: Improved component signature with explicit typing.

The component has been refactored from an arrow function to a named function with explicit Readonly<DisplayIconProps> typing, which is a good practice for preventing accidental props mutation. The addition of an optional className prop allows for flexible external styling.


15-36:

❓ Verification inconclusive

Enhanced accessibility and styling with utility classes.

The component now uses proper semantic HTML elements with utility classes, improving both accessibility and maintainability. The aria-labelledby attribute on the h2 element appropriately references the label's ID, creating a programmatic association between the label and text.

However, there's a potential issue with using the label value directly as an ID.


🏁 Script executed:

#!/bin/bash
# Check if label values contain characters that would make them invalid HTML IDs
rg "DisplaySmall\(" -A 10 | grep -E "label\s*=\s*[\"\']" | grep -E "[^\w\-:]"

Length of output: 105


Below is an updated shell script to re‐verify the issue (using a modified regex that avoids the previous “invalid range” error). Please run this script and check if any output is produced—any output would indicate that the extracted label contains characters outside the allowed set for HTML IDs.

Action Required:

  • Manual Verification Needed: Please run this script to confirm whether the label values may contain any invalid characters. If the script produces any output, consider sanitizing the label value before using it as an HTML ID.

🏁 Script executed:

#!/bin/bash
# Re-run the check on label values from DisplaySmall to detect any invalid characters for HTML IDs.
# This script extracts the label attribute value and filters for any characters outside: letters, digits, colon, underscore, or hyphen.
rg "DisplaySmall\(" -A 10 | \
grep -E "label\s*=\s*['\"]" | \
sed -E "s/.*label\s*=\s*['\"]([^'\"]+)['\"].*/\1/" | \
grep -E "[^:[:alnum:]_-]"

Length of output: 268


Enhanced accessibility verified—please manually confirm HTML ID validity in labels.

The changes in src/lib/display/small.tsx effectively improve semantic structure and accessibility by correctly associating the label with its corresponding text using aria-labelledby. Automated checks for invalid characters in the label (used as an HTML ID) did not return any results, suggesting that the labels likely conform to valid HTML ID standards. However, the automated validation encountered issues (e.g., regex errors), so please manually verify that the label values do not include characters (such as spaces or other special symbols) that could invalidate them as HTML IDs.

src/lib/progress/steps/horizontal-bullet.tsx (3)

32-54: Enhanced accessibility with ARIA attributes and semantic structure.

The container div now includes appropriate ARIA attributes (aria-label, role, aria-current, aria-disabled) that improve the accessibility of the step indicator. The conditional class names using clsx effectively replace the styled-component approach.


55-63: Well-structured responsive layout with utility classes.

The text wrapper div effectively uses Tailwind's responsive classes to handle different layouts on smaller vs. larger screens. The reference to textRef for dynamic height calculation is maintained from the previous implementation.


64-74: Improved heading with semantic structure and ARIA association.

The h2 element now has a unique ID and uses appropriate text styling classes based on the active state. This creates a more accessible and semantically correct heading.

src/lib/form/radio-group.tsx (6)

1-13: Well-organized imports with appropriate dependencies.

The component imports the necessary React Aria components for accessibility and the utility functions for class name management.


14-29: Clear interface definitions with good documentation.

The interfaces extend the React Aria interfaces and include proper JSDoc documentation with links to the React Aria documentation. The RadioOption interface appropriately requires a label property for each option.


31-41: Well-documented component with clear prop defaults.

The component includes JSDoc documentation with a link to the React Aria documentation and sets a reasonable default for the small prop.


42-61: Accessible group structure with orientation support.

The component uses the React Aria RadioGroup component for accessibility and includes comprehensive conditional styling for both horizontal and vertical orientations. The group label is properly rendered as a semantic Label component with appropriate styling.


62-101: Well-implemented radio buttons with comprehensive state styling.

The mapping of options to radio buttons is well-structured, and the component uses render props to access various interaction states (isSelected, isHovered, etc.). The conditional styling based on these states is comprehensive and visually consistent. The use of pseudo-elements for the radio circle visualization is a clean approach.


102-109: Appropriate error handling with accessible error message.

The component includes the React Aria FieldError component with proper styling and the ability to pass custom props through fieldErrorProps.

src/lib/container/card.tsx (2)

1-2: Imports look good.
Basic React and utility imports are appropriately organized.


9-24: Straightforward utility-based styling approach.
The Tailwind-like CSS classes and conditional logic for rounding and hover effects are well-structured. The ...props spread ensures good extensibility.

src/lib/form/bignumber-field/index.tsx (5)

22-33: Functional component signature is well-defined.
Handling isDisabled, isReadOnly, and an optional propId ensures flexibility.


39-47: Custom hook integration is clean.
useBigNumberField provides cohesive ARIA-compliant props. Great job abstracting complexity into a separate hook for maintainability.


50-81: Thoughtful Tailwind utility usage.
The combination of cn and clsx for dynamic classes based on state and variant is concise. The focus and placeholder states are well-handled.


138-157: Smart separation of variant icons from custom icons.
Allowing either a variant-driven icon or a user-provided icon fosters reusability.


161-179: Message section is clear and accessible.
Displaying error messages via errorMessageProps or fallback to descriptionProps is a nice accessibility pattern.

src/lib/form/checkbox.tsx (2)

1-2: Imports are standard.
The combination of React and react-aria-components for improved accessibility is consistent with the rest of the refactoring.


15-57: Usage of AriaCheckbox for accessibility.
Integrating AriaCheckbox with dynamic styling is well-executed. The isSelected state is handled elegantly, including the checkmark animation.

src/lib/progress/timeline/index.tsx (6)

3-4: No issues with importing clsx and the cn utility.
These imports help maintain consistent and consolidated class handling in the component.


14-14: Introducing a className prop is a good addition.
It allows consumers of the component to add custom styles more flexibly.


17-18: Clear and concise component documentation.
The doc comment aids maintainability by clarifying the component’s purpose.


21-26: Nice accessibility enhancements with aria-label and role="list".
This labeling and role attribute help screen readers interpret this as a timeline for users.


28-39: Well-structured iteration over timeline items.
Propagating item properties and handling transformations with Tailwind classes via clsx is clear and straightforward.


53-54: Default export is properly defined.
No issues found.

src/lib/messages/push.tsx (11)

6-7: cn import and Button usage from react-aria-components look good.
The Button component improves accessibility out of the box.


10-10: Designating explicit variant options.
This union type for variant is a good approach for type safety.


17-17: className prop usage is fine.
This prop helps extend styling as needed.


20-20: Defaulting small to false is reasonable.
No issues observed, and it simplifies usage by not requiring an explicit prop.


25-26: Concise destructuring to access props and maintain clarity.
It cleanly sets up local usage of variant, title, msg, etc.


30-45: Good usage of Tailwind utility classes for dynamic sizing.
Using conditional arrays in cn neatly organizes the styling differences for small vs. default.


48-50: Properly rendering icons based on the variant.
Straightforward logic, easy to read.


51-51: Excellent positioning for main text with margin-left.
Ensures icons and text spacing is consistent.


55-56: Correct usage of heading element.
Using <h2> for the title helps with semantic structure.


62-68: Use of react-aria-components <Button> for the close icon is commendable.
onPress is more accessible than a plain click event.


69-71: Wrapper structure is consistent and complete.
No issues found in the final return statement.

src/lib/copiable/index.tsx (11)

5-6: No issues with cn and Button imports.
They streamline class handling and improve accessibility.


7-7: Ensuring Button from react-aria-components is beneficial for a11y.
No concerns here.


9-9: Clear documentation on copiableContent.
Good practice clarifying how it is used.


11-11: Optional info prop is well handled.
Prevents complexity when no tooltip text is needed.


13-15: Logical docstring for iconPlacement.
Defaults to right for consistent usage across the codebase.


31-39: Good approach to default iconPlacement = "right" and keep the component flexible.
Spreading ...props also ensures any extra attributes are forwarded.


53-60: Neat inline-flex layout with directional classes.
The gap-2 helps visually distinguish text from the icon.


62-68: Tooltip usage is straightforward and consistent.
isCopied state toggling is handled nicely.


69-75: Accessible button usage for copying.
onPress is properly disabled when already copied, preventing repeated triggers.


76-77: Proper container closing and completed returns.
All state and logic are cleanly encapsulated.


79-79: Export is well-defined.
No issues with the final default export.

src/lib/dropdown/select/index.tsx (12)

1-9: Imports for React, clsx, and react-aria-components are correct and clearly define dependencies.
No issues here.


10-14: Imports for the local files (SimpleButton, IItem, DropdownButton, etc.) look correct.
They keep the module structure well organized.


16-19: Extending AriaSelectProps ensures the component remains compatible with standard select behaviors.
Defining a callback to receive a selected item object is a neat addition.


21-23: Allowing label and optional simpleButton/smallButton.
Keeps usage flexible for different dropdown styles.


26-30: Clear component documentation.
Helps maintain clarity on usage and props.


31-36: Consistent destructuring of props.
Reduces boilerplate and keeps the function signature concise.


37-44: Callback function properly locates the selected item by matching selectedKey.
This is a straightforward and robust approach.


47-51: Applying className and onSelectionChange with AriaSelect is well-structured.
Merging everything in cn("flex flex-col gap-1", className) fosters consistent styling.


53-70: Excellent conditional rendering within AriaSelect.

  • The label is displayed only when defined.
  • FieldError is used for error feedback, which improves usability.
  • DropdownContainer is well-encapsulated.

72-72: No issues in the final return block.
It properly wraps children in <AriaSelect>.


73-73: Export statement is correct.
No concerns here.


75-75: Default export declared cleanly.
Implementation is complete and consistent.

src/stories/text-field.stories.tsx (5)

42-49: Looks good as a default story.
No concerns with the default textual usage and class handling.


51-56: Story variant is appropriate.
Showcasing the "success" state is consistent with the provided variants.


58-63: Well-structured custom icon example.
Demonstrates how to substitute the default icon with a custom SVG effectively.


65-70: Label control is consistent.
Including a labeled version helps highlight accessibility and clarity.


72-78: Good demonstration of descriptive messaging.
This showcases how to supply user guidance or additional details below the field.

src/lib/display/icon.tsx (2)

3-5: Imports align with the new utility-first styling approach.
Leveraging cn and clsx for class composition, and react-aria-components for accessible labeling is consistent with the broader library refactor.


11-11: Optional className prop.
Allowing a className override is a good practice for library consumers to provide additional styling or override defaults.

src/lib/progress/timeline/bullet.tsx (6)

2-5: Use of colorRegex and isUndefined is clear.
These imports neatly handle dynamic coloring and undefined checks for the party prop or variant.


22-22: Optional className prop is consistent with library patterns.
This ensures outside consumers can apply layout or styling overrides as needed.


31-45: Robust ARIA attributes.
You're correctly specifying roles, states (aria-current, aria-busy, aria-disabled), and an accessible label for the overall list item. This fosters an inclusive user experience for assistive technologies.


64-65: The heading and aria-label usage.
Defining an aria-label for the heading helps clarify the timeline item’s title for screen readers.


75-95: Dynamic party text color handling is effective.
Applying a fallback color class for party text and defaulting to a known color if the variant is undefined ensures a consistent visual representation. The colorRegex usage for custom hex color is a neat extension.


109-115: Subtitle is well-handled.
Using a <small> tag with appropriate text classes for the subtitle is aligned with typical timeline item design patterns.

src/lib/form/datepicker/display-button.tsx (3)

13-17: Context-driven date picker state logic is clear.
Tapping into DatePickerStateContext and exposing an open() method is a neat approach to reduce prop-passing overhead and keep the code modular.


19-27: Hover and focus states highlight the control well.
Border, background, and error highlighting are well-managed with utility classes.


28-43: Segment-based date editing is accessible.
Using DateSegment to handle placeholders and a focus style is a best practice for accessible date input controls.

src/lib/form/text-field.tsx (1)

30-114: The TextField implementation looks good and uses React Aria components correctly.

The component correctly implements a text field with accessibility features using React Aria components, properly handles different variants, and conditionally renders status icons and messages. The code structure is clean and follows best practices.

src/styles/theme.css (1)

1-70: Well-structured theme variables with light and dark mode support.

The theme variables are well-organized and provide comprehensive color, shadow, and transition definitions for both light and dark modes. The naming convention is consistent and follows the project's namespace approach.

src/lib/dropdown/cascader/item.tsx (2)

14-84: Well-implemented accessible cascader item with proper state handling.

The component correctly uses React Aria's TreeItemContent to handle accessibility and state management for the cascader item. The implementation properly handles different states (selected, hovered, expanded, disabled) and provides appropriate styling for each state.


48-48:

❓ Verification inconclusive

Verify the continuePropagation method.

The e.continuePropagation() method is not a standard DOM event method. Verify if this is a custom method provided by react-aria-components, otherwise it might need to be e.stopPropagation() to prevent event bubbling or something else depending on the intended behavior.


🏁 Script executed:

#!/bin/bash
# Check if continuePropagation is a custom method in react-aria-components

# Search for the method name in the project
rg -i "continuePropagation" --type ts --type tsx

Length of output: 76


I'll re-run the search using file glob patterns (instead of relying on predefined file types) to cover both ".ts" and ".tsx" files. This should help us verify if the continuePropagation method is defined anywhere in the project.

Please execute this script and share the output for further verification.


🏁 Script executed:

#!/bin/bash
# Search for the "continuePropagation" method in TypeScript and TSX files using file glob patterns.
rg -i "continuePropagation" -g "*.ts" -g "*.tsx"

Length of output: 244


Attention: Verify the Custom Event Propagation Handling

It appears that e.continuePropagation() is not a standard DOM event method and no definition for it was found in the codebase. Please verify whether this method is intended as a custom implementation from react-aria-components or if it should be replaced with the standard e.stopPropagation() to achieve the desired event-handling behavior.

  • File: src/lib/dropdown/cascader/item.tsx
  • Line: 48
src/lib/dropdown/select/item.tsx (1)

25-58: Well-structured select item with appropriate accessibility features.

The component correctly uses React Aria's ListBoxItem for accessibility and implements appropriate styling for different states. The code handles optional icons and dot indicators well, and the structure follows React best practices.

src/stories/bignumber-field.stories.tsx (3)

1-55: LGTM! Good structure and organization of the Storybook metadata.

The component meta configuration is well-organized with comprehensive controls for all props, making it highly interactive for Storybook users.


58-64: LGTM! Clear default story setup.

The default story provides a good baseline with essential props that will help users understand the component's basic usage.


66-177: LGTM! Comprehensive set of examples showcasing various features.

The stories cover a wide range of functionality including labels, min/max constraints, large number handling, formatting options, validation states, and disabled/readonly modes - providing excellent documentation and testing of the component capabilities.

🧰 Tools
🪛 Biome (1.9.4)

[error] 156-156: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

src/stories/text-area.stories.tsx (4)

1-54: LGTM! Well-structured story configuration.

The metadata setup with comprehensive controls follows the same pattern as other form components, maintaining consistency across the codebase. Good inclusion of key properties like resize options that are specific to text areas.


56-68: LGTM! Clear examples of basic variants.

The Variant and Labelled stories match the same patterns used in text-field.stories.tsx, maintaining a consistent API across form components.


70-78: LGTM! Good demonstration of text area-specific features.

The Resizable story effectively showcases the unique resizing capabilities of the text area component, an important differentiation from other form inputs.


80-102: LGTM! Form integration example follows established pattern.

The Required story demonstrates form integration and validation exactly as implemented in other form component stories, maintaining consistency in API usage patterns.

src/stories/dropdown-cascader.stories.tsx (2)

1-74: LGTM! Well-structured dropdown cascader story with complex example data.

The component metadata and base story are well implemented with a good example of nested hierarchical data structure that demonstrates the cascading selection capabilities.


92-115: LGTM! Good form integration example.

The RequiredSelect story effectively demonstrates how the component integrates with React Aria's Form component for validation, following the same pattern used in other form components.

src/lib/progress/timeline/custom.tsx (3)

2-3: LGTM! Improved imports and dependencies.

Clean refactoring to remove styled-components dependencies and add the utility function for class name merging.


5-15: LGTM! Interface simplification and added className prop.

Good removal of unused interfaces and addition of the className prop for better component customization.


17-42: LGTM! Improved accessibility and styling approach.

Excellent refactoring to replace styled-components with utility-first CSS classes. The addition of ARIA attributes (aria-label="Timeline" and role="list") improves accessibility significantly.

src/lib/progress/timeline/spine.tsx (2)

1-1: Import patterns and utility update look good

The updated imports and exports are well-structured, importing clsx for conditional class name handling and the isUndefined utility. The colorRegex is properly exported.

Also applies to: 3-5


38-69: Great refactoring to Tailwind CSS

The component has been effectively refactored from styled-components to Tailwind CSS utility classes. The implementation correctly handles:

  1. Conditional rendering of the top line based on topHeight
  2. Flexible display of either a custom icon or a styled circle
  3. Conditional styling based on the variant prop
  4. Proper inline styling when variant is a hex color

The flex layout is well-structured and the conditional class application using clsx is appropriate.

src/lib/pagination/standard.tsx (4)

1-7: Good import structure with React Aria components

The imports are well-organized, bringing in React Aria's Button component for accessibility improvements and utilities like cn and clsx for class name handling.


8-36: Well-implemented PageButton component with conditional styling

The PageButton component is nicely encapsulated with proper TypeScript typing. It effectively:

  1. Extends React Aria's Button props and adds a selected state
  2. Implements conditional styling based on selection state
  3. Uses a clean pattern for hover states and color transitions
  4. Properly forwards all props to the underlying Button component

This approach creates a consistent button experience throughout the pagination component.


37-46: Good documentation for new props

The added JSDoc comments explain the new disableNumbers and hideNumbers props clearly, which is helpful for component users.


48-95: Excellent refactoring to React Aria and Tailwind

The StandardPagination component has been properly refactored to:

  1. Use React Aria's Button component via the PageButton wrapper
  2. Apply Tailwind CSS utility classes for styling
  3. Handle conditional rendering of number buttons
  4. Implement proper event handling via onPress instead of onClick
  5. Apply appropriate disabled states

The SVG arrow styling is particularly well done with conditional classes based on button state.

src/lib/display/large.tsx (3)

1-5: Good modernization of imports

The imports have been updated to include React Aria's Label component and the cn utility function, which aligns with the codebase's move to utility-first CSS and accessibility components.


7-13: Improved type safety with Readonly props

The component signature has been updated to a named function with Readonly<DisplayIconProps> typing, which is a good practice for ensuring immutability of props.


14-37: Well-implemented accessible display component

The DisplayLarge component has been effectively refactored to:

  1. Use a Card component with proper Tailwind utility classes
  2. Position the icon absolutely with appropriate size constraints
  3. Use semantic HTML with h1 for the main text
  4. Improve accessibility by using React Aria's Label component with proper aria-labelledby association
  5. Handle className prop correctly for component extensibility

The layout and styling are clean and responsive.

src/lib/progress/linear/index.tsx (5)

1-9: Good module organization with React Aria components

The imports are well-structured, bringing in React Aria's ProgressBar and Label components for accessibility improvements along with utility functions for class handling.


11-20: Well-documented props interface

The LinearProps interface is clearly defined with good JSDoc comments explaining the purpose of each prop. The extension of ProgressBar props with appropriate omissions shows good attention to component API design.


22-39: Optimized progress calculation with useMemo

The component effectively uses useMemo to calculate the progress percentage only when relevant values change. The default values for minValue and maxValue are sensibly set, and the function is properly typed with Readonly props.


40-82: Good SVG implementation with conditional animation

The SVG progress bar implementation is well done:

  1. Creates two paths - one for the background track and one for the filled portion
  2. Properly calculates the filled portion based on progress
  3. Uses CSS animation conditionally based on the animated prop
  4. Handles edge cases like empty progress values

The stroke-dasharray technique for animation is much cleaner than using JavaScript-based animations.


82-94: Well-structured timer display with icon

The timer display is cleanly implemented with:

  1. Conditional rendering based on timerText prop
  2. Good alignment of the hourglass icon and text
  3. Proper semantic structure and styling
  4. Appropriate text color for timer emphasis

The flex layout ensures consistent alignment of the icon and text.

src/lib/form/switch.tsx (2)

1-5: Imports look good and improve clarity.
Code appears to correctly import react-aria-components with a renamed Switch for clarity. No issues found here.


14-41: Implementation aligns excellently with react-aria-components.
This is a clean and accessible approach. Using the render prop ({ isSelected }) is a best practice to ensure ARIA state is accurately reflected. The utility classes in cn() also look consistent with the rest of the codebase.

README.md (5)

17-29: Overview sections are well-documented.
The introduction and features convey clear advantages of using the library. No issues found.


30-41: Components list is well-structured and descriptive.
Each section is helpful for new users.


44-79: Installation and setup instructions are detailed and user-friendly.
Good job outlining usage examples and steps.


80-110: Theme usage guidance is thorough.
Providing instructions on overriding theme variables is very helpful to end-users.

🧰 Tools
🪛 LanguageTool

[grammar] ~89-~89: It seems that a pronoun is missing.
Context: ...variables here. If want to override or edit the defined th...

(IF_VB)


113-146: Development and code quality sections are comprehensive.
Clear instructions on how to build and test the library locally.

eslint.config.mjs (3)

1-22: Import structure is concise and modern.
Using @eslint/compat to fix up plugin rules is a good practice for consistent linting behavior.


26-38: Lint configuration extensions appear well-structured.
The recommended and security legacy configs cover a broad range of rules. Looks good.


104-105: Confirm the rationale for disabling certain security rules.
Disabling detect-object-injection and detect-non-literal-fs-filename can open potential security risks, depending on usage patterns. Ensure these are intentionally disabled.

Would you like a script to scan for potential object injection usage or non-literal file paths in your codebase to confirm it is safe?

src/lib/button/index.tsx (2)

2-9: Imports look consistent and align with the new utility-based approach.

All imported modules appear to be in use, and the transition from styled-components to react-aria-components plus the cn utility is well-structured.


26-35: Interfaces validate the props clearly.

The ButtonProps extension from AriaButtonProps and the omission of $loading appear intentional and help ensure only permissible props are exposed. This design can reduce confusion and strengthen component reusability.

src/lib/pagination/compact.tsx (3)

5-7: Switch to react-aria-components meets accessibility standards.

The imports of cn, ButtonProps, and clsx suggest a consistent approach to utility classes. The overall structure for pagination is clear.


9-31: ArrowButton succinctly incorporates accessibility traits.

The small wrapper around Button properly applies class names and hover states. No major issues are noted here.


43-86:

✅ Verification successful

Verify no conflicting onClick usage remains.

The switch to onPress for incrementPage and decrementPage is correct for react-aria-components. Ensure no older code references onClick instead of onPress.

Use this script to confirm no leftover onClick references in pagination components:


🏁 Script executed:

#!/bin/bash
rg -A4 "onClick" src/lib/pagination

Length of output: 35


Confirmed: The pagination component correctly uses onPress with no residual onClick references.

  • The search in the src/lib/pagination directory produced no output, indicating that all usages of event handlers now follow the onPress convention as required by react-aria-components.
  • No further legacy onClick references were detected, so no additional changes are necessary.
package.json (2)

80-85: Peer dependencies align with Tailwind-based refactor.

Declaring @tailwindcss/postcss and tailwindcss in peerDependencies is consistent with the shift from styled-components to utility-first CSS. This helps ensure the parent apps have the correct toolchain installed.


3-3:

❓ Verification inconclusive

Validate major version bump.

Upgrading from 2.x to 3.0.0 is a breaking change. Confirm that the consuming packages and environments are ready for this major version shift.

Please ensure no dependent code relies on the older version constraints by searching and auditing references:


🏁 Script executed:

#!/bin/bash
rg "@kleros/ui-components-library@2" --ignore-case

Length of output: 50


Major Version Upgrade Verification: Manual Confirmation Needed

Upgrading from 2.x to 3.0.0 is a breaking change. Our automated search for references to @kleros/ui-components-library@2 returned no matches. However, to confidently proceed:

  • Action Required: Manually verify that no consuming packages or lock files (e.g., package-lock.json, yarn.lock) reference the older version.
  • Next Steps: Double-check across the entire codebase and dependency declarations to ensure that all consuming environments are prepared for the major version bump.
src/lib/dropdown/cascader/index.tsx (3)

1-9: Refactor to react-aria-components improves accessibility.

Moving to Select-based building blocks ensures proper keyboard, focus, and screen reader support with minimal boilerplate.


14-19: Confirm callback requirements.

The callback prop is required; validate that upstream components or consumers always supply it. Otherwise, consider marking it optional or providing a no-op default.


33-63: Nicely structured cascader flow.

The code neatly wraps label handling, field error rendering, and the dropdown container’s nested items. This approach is consistent with the new utility-based design patterns in the PR.

src/lib/breadcrumb.tsx (1)

15-29: Clean usage of utility classes in Content component.
This component follows best practices for composable, reusable UI elements. No issues found.

src/lib/dropdown/cascader/dropdown-container.tsx (3)

16-22: Good approach reusing partial props.
Using Pick<IDropdownCascader, ...> ensures consistency with the main interface while limiting scope. No concerns here.


42-44: Automatic expansion on default selection.
When defaultSelectedKey is set and isOpen is true, the code expands parent keys. This is user-friendly. Just ensure performance is acceptable for large trees.


80-157: Overall selection & expansion logic.
The combination of disallowEmptySelection plus dynamic scrolling on each selection offers a smooth user experience. No immediate issues seen.

src/lib/progress/circular/index.tsx (2)

5-16: Well-defined prop interface.
Defining progress with value, minValue, maxValue, and an optional animated flag is clear. No issues here.


43-46: Accessible progress bar logic.
Using react-aria-components for the progress bar ensures accessibility. The CSS-based animation is straightforward, and the fallback text display ({progress}%) also looks good.

Also applies to: 48-82

src/lib/form/datepicker/index.tsx (14)

1-11: Imports look good.
No immediate concerns with these imports; they appear to be properly utilized in the component.


12-16: Additional imports verified.
All imported subcomponents (CustomButton, Calendar, TimeControl) and utilities are used appropriately.


18-18: Utility import confirmation.
cn is a clear approach for merging Tailwind classes and handling conditional styling. No issues found.


20-28: Well-structured interface.
The DatePickerProps interface is clearly defined, and the omission of granularity, hourCycle, and firstDayOfWeek from the underlying DatePickerProps is a suitable approach to maintain control within this custom component.


30-44: Default parameters and prop forwarding look correct.
Using now(getLocalTimeZone()) for defaultValue and conditionally setting granularity based on the time prop is a neat approach. Everything is consistent.


46-47: No issues with render prop usage.
Destructuring the state object from the render function is standard usage for react-aria-components.


49-52: Conditional label classes.
Hiding the label when it's not provided is straightforward and user-friendly.


54-54: Label fallback.
Defaulting the label to "Date" when not specified is sensible.


57-58: Display and error components.
Rendering DisplayButton and FieldError is clean and keeps form feedback visible.


60-66: Popover styling logic seems fine.
Conditionally applying width classes when time is true is clear and well-organized.


68-75: Dialog layout with optional time control.
Passing minValue to <TimeControl> is consistent, likely ensuring time constraints align with the date constraints.


86-91: Select button usage confirmed.
Closing the popover on "Select" click is a solid user experience.


93-97: Popover closure and final render.
All structural elements align with react-aria-components best practices.


99-99: No additional concerns.
The component definition wraps up cleanly.

src/lib/form/bignumber-field/useBigNumberField.tsx (8)

1-11: Initial imports and BigNumber usage.
All imported hooks appear to be needed for the custom field logic. Looks well-prepared for advanced numeric handling.


12-29: FormatOptions interface is comprehensive.
Providing extensive customization (prefix/suffix, grouping, decimals) is helpful for diverse numeric requirements.


31-66: BigNumberFieldProps type checks.
Defines clear, flexible props (including min, max, step, and event handlers). Good coverage of edge cases.


68-79: Default format.
Applying a standard decimal separator, group separator, and prefix/suffix ensures a consistent base. No issues found.


80-146: Hook initialization and BigNumber configuration.
Using a useEffect for dynamic BigNumber.config based on formatOptions is straightforward.


148-180: Controlled/uncontrolled logic.
The approach to support both value (controlled) and defaultValue (uncontrolled) is well-structured, with checks that parse and store the initial BigNumber state.


182-234: Arithmetic and clamping.
Increment/decrement logic looks correct, and boundary checks (min/max) are effectively enforced. Good defaulting with step = "1".


236-355: Formatting approach with debouncing.
The 3-second delay before toFormat() reactivates is a nice balance for user input. Implementation is robust and avoids excessive re-rendering.

src/lib/form/file-uploader.tsx (15)

1-1: Initial import and state usage.
Using useState<File>() is appropriate for single-file handling.


8-8: Reusing cn utility.
Merging utility classes with cn is consistent with the rest of the codebase.


9-15: File-related imports.
FileTrigger, DropZone, and FileDropItem from react-aria-components are used correctly, promoting accessibility.


16-16: clsx import validated.
All class merges remain consistent; no conflict with cn.


18-20: Prop shape is clear.
callback to receive the file, optional message and variant for feedback, and acceptedFileTypes are well-defined.


22-23: Variant usage is typed.
Acceptable string unions for "success," "warning," "error," and "info" are well-handled.


25-26: isDisabled drop zone.
Supports disabling drag-and-drop if needed. Nicely handled.


32-34: Functional component definition.
Destructuring props is standard. Good use of Readonly<FileUploaderProps>.


44-45: Wrapping container.
Applying w-50 plus the user-supplied className is straightforward for styling.


46-62: DropZone setup.
Properly overriding default drop behavior. Good handling of accepted file types with custom logic in getDropOperation.


64-77: Drop handler logic.
Finding the first item that matches accepted types and sending it back via callback. Solid single-file approach.


79-89: FileTrigger onSelect.
Consistent with the drop logic, ensuring only one file is set and passed up.


90-109: Button presentation.
Displaying the file name or upload icon is user-friendly, with a clear hover/focus style.


111-139: Feedback rendering with variant icons.
Conditionally showing success/warning/error/info states next to the message is a neat design. Icons load as expected.


140-140: No extra concerns.
Exporting FileUploader completes the flow for a single-file drop or selection with custom feedback.

src/lib/tooltip/index.tsx (3)

2-3: Imports look consistent
No issues are found in the updated import statements.


14-26: Interface updates look well documented
The additions for tooltipProps, overlayArrowProps, and wrapperProps appear thoroughly documented and aligned with react-aria components references.


61-110: Overall tooltip rendering logic looks solid
The arrow positioning and conditional styling for each placement are well implemented.

src/lib/tag/index.tsx (2)

2-4: Import statements look good
The usage of react-aria-components Button is a suitable approach.


6-8: Interface extension with ButtonProps is appropriate
No issues found, and it ensures the Tag component inherits accessibility attributes.

src/lib/pagination/tabs.tsx (4)

1-15: Imports look consistent with react-aria-components usage
No issues found, everything is correctly imported for tab functionalities.


39-50: Interface extension aligns with react-aria's approach
Merging custom props with AriaTabsProps keeps the component flexible and accessible.


52-60: Local state management is straightforward
Storing the selectedKey in local state is a valid approach for controlling the Tabs. No concerns here.


61-144: Implementation of tab list and tab panels appears robust
The usage of Collection and mapping each item to a dedicated TabPanel is clean, ensuring a reliable tabs-to-panels pairing.

run: yarn
- name: Run ESLint
run: yarn check-style
- uses: actions/checkout@v2
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

Update actions/checkout to the latest version.

The workflow uses actions/checkout@v2, which is now outdated and may not be compatible with the latest GitHub Actions runners. Update to actions/checkout@v3 or later for improved security and compatibility.

-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
📝 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
- uses: actions/checkout@v2
- uses: actions/checkout@v3
🧰 Tools
🪛 actionlint (1.7.4)

9-9: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

run: yarn
- name: Run TypeScriptCompiler
run: yarn check-types
- uses: actions/checkout@v2
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

Update actions/checkout to the latest version.

The workflow uses actions/checkout@v2, which is now outdated and may not be compatible with the latest GitHub Actions runners. Update to actions/checkout@v3 or later for improved security and compatibility.

-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
📝 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
- uses: actions/checkout@v2
- uses: actions/checkout@v3
🧰 Tools
🪛 actionlint (1.7.4)

9-9: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

Comment on lines +1 to +4
@import "tailwindcss";
@plugin "tailwindcss-react-aria-components";

@import "./theme.css";
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 the @import position

The @import "./theme.css"; statement is in the wrong position according to CSS standards. @import rules must precede all other at-rules and style rules in a stylesheet (except @charset).

@import "tailwindcss";
@plugin "tailwindcss-react-aria-components";
+@import "./theme.css";

-@import "./theme.css";

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

🧰 Tools
🪛 Biome (1.9.4)

[error] 4-4: This @import is in the wrong position.

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
Consider moving import position.

(lint/correctness/noInvalidPositionAtImportRule)

Comment on lines +35 to +45
export const StandardPagination: Story = {
args: {
themeUI: "light",
backgroundUI: "light",
numPages: 6,
currentPage: 0,
callback: () => {},
className: "w-full",
disableNumbers: false,
hideNumbers: 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

Inconsistency between args and state initialization

There's an inconsistency between the initial currentPage value in args (0) and the useState initialization (1). This could lead to unexpected behavior when the story is rendered.

export const StandardPagination: Story = {
  args: {
    themeUI: "light",
    backgroundUI: "light",
    numPages: 6,
-   currentPage: 0,
+   currentPage: 1,
    callback: () => {},
    className: "w-full",
    disableNumbers: false,
    hideNumbers: false,
  },
📝 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
export const StandardPagination: Story = {
args: {
themeUI: "light",
backgroundUI: "light",
numPages: 6,
currentPage: 0,
callback: () => {},
className: "w-full",
disableNumbers: false,
hideNumbers: false,
},
export const StandardPagination: Story = {
args: {
themeUI: "light",
backgroundUI: "light",
numPages: 6,
currentPage: 1,
callback: () => {},
className: "w-full",
disableNumbers: false,
hideNumbers: false,
},

Comment on lines +16 to +107
const Calendar: React.FC = () => (
<AriaCalender
className="flex w-82.5 flex-col items-center"
firstDayOfWeek="mon"
>
<header
className={clsx(
"flex h-16 w-full items-center justify-between p-6",
"border-b-klerosUIComponentsStroke border-b",
)}
>
<Button
slot="previous"
className={clsx(
"focus:outline-klerosUIComponentsPrimaryBlue rounded-base focus:outline-offset-2",
"cursor-pointer disabled:cursor-default",
)}
>
{({ isDisabled, isHovered }) => (
<Arrow
className={cn(
"fill-klerosUIComponentsPrimaryBlue ease-ease size-4 transition",
isDisabled && "fill-klerosUIComponentsStroke",
isHovered && "fill-klerosUIComponentsSecondaryBlue",
)}
/>
)}
</Button>
<Heading className="text-klerosUIComponentsPrimaryText text-base font-semibold select-none" />
<Button
slot="next"
className="focus:outline-klerosUIComponentsPrimaryBlue rounded-base cursor-pointer focus:outline-offset-2"
>
{({ isHovered }) => (
<Arrow
className={cn(
"ease-ease size-4 rotate-180 transition",
"fill-klerosUIComponentsPrimaryBlue",
isHovered && "fill-klerosUIComponentsSecondaryBlue",
)}
/>
)}
</Button>
</header>
<CalendarGrid
className={cn(
"mt-4 mb-6",
"border-separate border-spacing-x-1.75 border-spacing-y-0.5",
)}
weekdayStyle="short"
>
<CalendarGridHeader>
{(day) => (
<CalendarHeaderCell
className={clsx(
"size-6 cursor-pointer pb-1",
"text-klerosUIComponentsPrimaryText text-center text-sm font-semibold",
)}
>
{day.substring(0, 2)}
</CalendarHeaderCell>
)}
</CalendarGridHeader>
<CalendarGridBody>
{(date) => (
<CalendarCell
date={date}
className={({ isFocused, isUnavailable, isDisabled, isSelected }) =>
cn(
"flex size-6 cursor-pointer items-center justify-center rounded-full",
"text-klerosUIComponentsSecondaryText text-center text-sm font-semibold",
"hover:bg-klerosUIComponentsSecondaryBlue hover:text-klerosUIComponentsWhiteBackground",
"outside-month:hidden",
isSelected && [
"bg-klerosUIComponentsPrimaryBlue text-klerosUIComponentsWhiteBackground",
"hover:bg-klerosUIComponentsPrimaryBlue",
],
(isDisabled || isUnavailable) &&
"text-klerosUIComponentsStroke cursor-not-allowed",
isFocused && [
"outline-klerosUIComponentsPrimaryBlue outline-2",
],
)
}
>
{date.day.toString().length === 1 ? `0${date.day}` : date.day}
</CalendarCell>
)}
</CalendarGridBody>
</CalendarGrid>
</AriaCalender>
);
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

Consider adding props for better component flexibility

The Calendar component is implemented as a one-way functional component with no props, which limits its customization potential. Consider adding props to allow for:

  1. Custom date selection handlers
  2. Localization options (first day of week, month/day names)
  3. Minimum/maximum selectable dates
  4. Custom styling overrides
-const Calendar: React.FC = () => (
+interface CalendarProps {
+  onDateSelect?: (date: Date) => void;
+  minDate?: Date;
+  maxDate?: Date;
+  locale?: string;
+  firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
+  className?: string;
+}
+
+const Calendar: React.FC<CalendarProps> = ({
+  onDateSelect,
+  minDate,
+  maxDate,
+  locale = 'en-US',
+  firstDayOfWeek = 'mon',
+  className,
+}) => (
   <AriaCalender
-    className="flex w-82.5 flex-col items-center"
-    firstDayOfWeek="mon"
+    className={cn("flex w-82.5 flex-col items-center", className)}
+    firstDayOfWeek={firstDayOfWeek}
+    minValue={minDate}
+    maxValue={maxDate}
+    onChange={onDateSelect}
📝 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 Calendar: React.FC = () => (
<AriaCalender
className="flex w-82.5 flex-col items-center"
firstDayOfWeek="mon"
>
<header
className={clsx(
"flex h-16 w-full items-center justify-between p-6",
"border-b-klerosUIComponentsStroke border-b",
)}
>
<Button
slot="previous"
className={clsx(
"focus:outline-klerosUIComponentsPrimaryBlue rounded-base focus:outline-offset-2",
"cursor-pointer disabled:cursor-default",
)}
>
{({ isDisabled, isHovered }) => (
<Arrow
className={cn(
"fill-klerosUIComponentsPrimaryBlue ease-ease size-4 transition",
isDisabled && "fill-klerosUIComponentsStroke",
isHovered && "fill-klerosUIComponentsSecondaryBlue",
)}
/>
)}
</Button>
<Heading className="text-klerosUIComponentsPrimaryText text-base font-semibold select-none" />
<Button
slot="next"
className="focus:outline-klerosUIComponentsPrimaryBlue rounded-base cursor-pointer focus:outline-offset-2"
>
{({ isHovered }) => (
<Arrow
className={cn(
"ease-ease size-4 rotate-180 transition",
"fill-klerosUIComponentsPrimaryBlue",
isHovered && "fill-klerosUIComponentsSecondaryBlue",
)}
/>
)}
</Button>
</header>
<CalendarGrid
className={cn(
"mt-4 mb-6",
"border-separate border-spacing-x-1.75 border-spacing-y-0.5",
)}
weekdayStyle="short"
>
<CalendarGridHeader>
{(day) => (
<CalendarHeaderCell
className={clsx(
"size-6 cursor-pointer pb-1",
"text-klerosUIComponentsPrimaryText text-center text-sm font-semibold",
)}
>
{day.substring(0, 2)}
</CalendarHeaderCell>
)}
</CalendarGridHeader>
<CalendarGridBody>
{(date) => (
<CalendarCell
date={date}
className={({ isFocused, isUnavailable, isDisabled, isSelected }) =>
cn(
"flex size-6 cursor-pointer items-center justify-center rounded-full",
"text-klerosUIComponentsSecondaryText text-center text-sm font-semibold",
"hover:bg-klerosUIComponentsSecondaryBlue hover:text-klerosUIComponentsWhiteBackground",
"outside-month:hidden",
isSelected && [
"bg-klerosUIComponentsPrimaryBlue text-klerosUIComponentsWhiteBackground",
"hover:bg-klerosUIComponentsPrimaryBlue",
],
(isDisabled || isUnavailable) &&
"text-klerosUIComponentsStroke cursor-not-allowed",
isFocused && [
"outline-klerosUIComponentsPrimaryBlue outline-2",
],
)
}
>
{date.day.toString().length === 1 ? `0${date.day}` : date.day}
</CalendarCell>
)}
</CalendarGridBody>
</CalendarGrid>
</AriaCalender>
);
interface CalendarProps {
onDateSelect?: (date: Date) => void;
minDate?: Date;
maxDate?: Date;
locale?: string;
firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
className?: string;
}
const Calendar: React.FC<CalendarProps> = ({
onDateSelect,
minDate,
maxDate,
locale = 'en-US',
firstDayOfWeek = 'mon',
className,
}) => (
<AriaCalender
className={cn("flex w-82.5 flex-col items-center", className)}
firstDayOfWeek={firstDayOfWeek}
minValue={minDate}
maxValue={maxDate}
onChange={onDateSelect}
>
<header
className={clsx(
"flex h-16 w-full items-center justify-between p-6",
"border-b-klerosUIComponentsStroke border-b",
)}
>
<Button
slot="previous"
className={clsx(
"focus:outline-klerosUIComponentsPrimaryBlue rounded-base focus:outline-offset-2",
"cursor-pointer disabled:cursor-default",
)}
>
{({ isDisabled, isHovered }) => (
<Arrow
className={cn(
"fill-klerosUIComponentsPrimaryBlue ease-ease size-4 transition",
isDisabled && "fill-klerosUIComponentsStroke",
isHovered && "fill-klerosUIComponentsSecondaryBlue",
)}
/>
)}
</Button>
<Heading className="text-klerosUIComponentsPrimaryText text-base font-semibold select-none" />
<Button
slot="next"
className="focus:outline-klerosUIComponentsPrimaryBlue rounded-base cursor-pointer focus:outline-offset-2"
>
{({ isHovered }) => (
<Arrow
className={cn(
"ease-ease size-4 rotate-180 transition",
"fill-klerosUIComponentsPrimaryBlue",
isHovered && "fill-klerosUIComponentsSecondaryBlue",
)}
/>
)}
</Button>
</header>
<CalendarGrid
className={cn(
"mt-4 mb-6",
"border-separate border-spacing-x-1.75 border-spacing-y-0.5",
)}
weekdayStyle="short"
>
<CalendarGridHeader>
{(day) => (
<CalendarHeaderCell
className={clsx(
"size-6 cursor-pointer pb-1",
"text-klerosUIComponentsPrimaryText text-center text-sm font-semibold",
)}
>
{day.substring(0, 2)}
</CalendarHeaderCell>
)}
</CalendarGridHeader>
<CalendarGridBody>
{(date) => (
<CalendarCell
date={date}
className={({ isFocused, isUnavailable, isDisabled, isSelected }) =>
cn(
"flex size-6 cursor-pointer items-center justify-center rounded-full",
"text-klerosUIComponentsSecondaryText text-center text-sm font-semibold",
"hover:bg-klerosUIComponentsSecondaryBlue hover:text-klerosUIComponentsWhiteBackground",
"outside-month:hidden",
isSelected && [
"bg-klerosUIComponentsPrimaryBlue text-klerosUIComponentsWhiteBackground",
"hover:bg-klerosUIComponentsPrimaryBlue",
],
(isDisabled || isUnavailable) &&
"text-klerosUIComponentsStroke cursor-not-allowed",
isFocused && [
"outline-klerosUIComponentsPrimaryBlue outline-2",
],
)
}
>
{date.day.toString().length === 1 ? `0${date.day}` : date.day}
</CalendarCell>
)}
</CalendarGridBody>
</CalendarGrid>
</AriaCalender>
);

Comment on lines +78 to +90
export const RequiredOptions: Story = {
args: {
themeUI: "dark",
backgroundUI: "light",
groupLabel: "Variants:",
options: [
{ value: "primary", label: "Primary" },
{ value: "secondary", label: "Secondary" },
],
small: true,
isRequired: true,
isReadOnly: true,
},
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

Conflicting accessibility props in RequiredOptions story

The story includes both isRequired: true and isReadOnly: true, which could potentially create conflicting states - a field typically shouldn't be both required and read-only simultaneously.

Consider creating separate stories for required and read-only states, or clarify the intention behind combining these states:

export const RequiredOptions: Story = {
  args: {
    themeUI: "dark",
    backgroundUI: "light",
    groupLabel: "Variants:",
    options: [
      { value: "primary", label: "Primary" },
      { value: "secondary", label: "Secondary" },
    ],
    small: true,
    isRequired: true,
-   isReadOnly: true,
  },
  // ...
📝 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
export const RequiredOptions: Story = {
args: {
themeUI: "dark",
backgroundUI: "light",
groupLabel: "Variants:",
options: [
{ value: "primary", label: "Primary" },
{ value: "secondary", label: "Secondary" },
],
small: true,
isRequired: true,
isReadOnly: true,
},
export const RequiredOptions: Story = {
args: {
themeUI: "dark",
backgroundUI: "light",
groupLabel: "Variants:",
options: [
{ value: "primary", label: "Primary" },
{ value: "secondary", label: "Secondary" },
],
small: true,
isRequired: true,
},
// ...
}

)}
{...props}
>
<SelectValue<IItem>>
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 syntax error in SelectValue component.

There's an extra closing bracket in the SelectValue generic type declaration.

-      <SelectValue<IItem>>
+      <SelectValue<IItem>
📝 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
<SelectValue<IItem>>
<SelectValue<IItem>


interface PushProps extends SmallProp, VariantProp {
title: string;
msg?: string;
//eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
callback: Function;
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

Avoid using Function as a type.
This can mask potential typing issues and hamper readability.

Here’s a suggested fix:

-  callback: Function;
+  callback: () => void;

Adjust parameters or return types if the callback requires them.

📝 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
callback: Function;
callback: () => void;
🧰 Tools
🪛 Biome (1.9.4)

[error] 16-16: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

transform: scaleY(0);
}
}
--animate-scale-out: slideOut var(--klerosUIComponentsTransitionSpeed) ease;
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 incorrect animation reference.

The --animate-scale-out property references slideOut keyframes, which don't exist in this file. It should reference scaleOut instead.

-  --animate-scale-out: slideOut var(--klerosUIComponentsTransitionSpeed) ease;
+  --animate-scale-out: scaleOut var(--klerosUIComponentsTransitionSpeed) ease;
📝 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
--animate-scale-out: slideOut var(--klerosUIComponentsTransitionSpeed) ease;
--animate-scale-out: scaleOut var(--klerosUIComponentsTransitionSpeed) ease;

Comment on lines +8 to 9
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
callback?: Function;
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

Define a specific callback signature.
Using the Function type is discouraged, as flagged by the linter. Replace it with a more explicit function type, e.g., (val: any) => void, to ensure type safety.

8 // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
9- callback?: Function;
+ callback?: (value: unknown) => void;
📝 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
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
callback?: Function;
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
callback?: (value: unknown) => void;
🧰 Tools
🪛 Biome (1.9.4)

[error] 9-9: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

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