Skip to content

add new props to datepicker#7

Merged
MrsLecter merged 2 commits intomasterfrom
feature/add-datepicker-modern
Jan 28, 2026
Merged

add new props to datepicker#7
MrsLecter merged 2 commits intomasterfrom
feature/add-datepicker-modern

Conversation

@MrsLecter
Copy link
Copy Markdown

@MrsLecter MrsLecter commented Jan 28, 2026

Summary

  • new props for datepicker and DateRangeInputModern to control the width/height and position of the modal window

Summary by CodeRabbit

  • New Features

    • Expanded datepicker customization options with enhanced control over styling and positioning parameters, enabling developers to tailor component appearance and placement to match their specific design requirements.
  • Chores

    • Package version bumped to 1.0.2.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 28, 2026

Walkthrough

The pull request bumps the styled package version from 1.0.1 to 1.0.2 and extends the DateRangeInputModern and Datepicker components with six new optional customization props for controlling datepicker styling and positioning (grid layout, dimensions, border radius, and absolute positioning coordinates).

Changes

Cohort / File(s) Summary
Version Update
packages/styled/package.json
Bumped version from 1.0.1 to 1.0.2
DateRangeInputModern Props Extension
packages/styled/src/components/DateRangeInputModern/DateRangeInputModern.tsx
Added six optional string props (datepickerSelectDateGridTemplateColumns, datepickerBorderRadiusCustom, datepickerWidthCustom, datepickerHeightCustom, datepickerLeftCustom, datepickerTopCustom) to interface; destructured and threaded to Datepicker component; updated positioning logic with fallbacks to theme defaults
Datepicker Props & Interface Extension
packages/styled/src/components/Datepicker/Datepicker.tsx
Added six optional props to DatepickerProps interface; extended StyledDatepicker interface with height, left, top members; integrated new props into theme initialization and styling logic with fallbacks to defaults

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Six new props hop into view,
Customization dreams come true!
Datepickers dance with style so fine,
Version bumped, the stars align!
Magic ✨ in the component design.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add new props to datepicker' accurately summarizes the main changes in the pull request, which adds six new optional props to the DateRangeInputModern and Datepicker components for customization.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/add-datepicker-modern

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@packages/styled/src/components/DateRangeInputModern/DateRangeInputModern.tsx`:
- Around line 271-273: The wrapper Box currently applies datepickerLeftCustom
and datepickerTopCustom but the inner Datepicker component also accepts
datepickerLeft and datepickerTop (which default to 0px), causing conflicting
two-layer positioning; fix this by forwarding the wrapper positioning props into
the Datepicker component (map datepickerLeftCustom -> datepickerLeft and
datepickerTopCustom -> datepickerTop when rendering Datepicker) or, if
positioning should be exclusively at the wrapper, remove
datepickerLeft/datepickerTop from the Datepicker API and stop passing/using
them; update the render where Datepicker is instantiated (and the Box wrapper
that uses datepickerLeftCustom/datepickerTopCustom) accordingly, and apply the
same change to the other occurrence around the 303-307 block.
🧹 Nitpick comments (3)
packages/styled/src/components/Datepicker/Datepicker.tsx (1)

235-235: Avoid using !important in CSS values.

Using !important can make styles difficult to override and debug. If a specific background override is required, consider using a more specific selector or adjusting the styled-components composition order.

♻️ Suggested fix
-    datepickerBackground: '#ffffff !important',
+    datepickerBackground: '#ffffff',

If there's a known CSS specificity issue this addresses, please document it in a comment explaining why !important is necessary.

packages/styled/src/components/DateRangeInputModern/DateRangeInputModern.tsx (2)

111-116: Consider consistent prop naming between components.

The props here use a "Custom" suffix (e.g., datepickerBorderRadiusCustom), while the Datepicker component uses props without this suffix (e.g., datepickerBorderRadius). This inconsistency may confuse consumers of the API.

Consider aligning the naming convention across both components for a more intuitive developer experience.


177-179: Unused theme properties.

datepickerHeight, datepickerLeft, and datepickerTop are defined in the theme object but are never used. The positioning logic uses dateRangeDatepickerWrapperLeft and dateRangeDatepickerWrapperTop instead (from getPlacement).

Consider removing these unused properties to avoid confusion.

♻️ Suggested fix
     dateRangeArrowIconOpacity: 1,
     dateRangeStartDateInputPadding: vertical ? (rtl ? '0 32px 0 8px' : '0 8px 0 32px') : '0 0x',
     dateRangeEndDateInputPadding: vertical ? (rtl ? '0 32px 0 8px' : '0 8px 0 32px') : '0 0px',
     dateRangeDatepickerWrapperPosition: 'absolute',
-    datepickerHeight: 'unset',
-    datepickerLeft: '0px',
-    datepickerTop: '0px',
     ...getPlacement(placement, rtl),

@MrsLecter MrsLecter merged commit a15cfb3 into master Jan 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant