PLASMA-7942: add custom radiuses for selected range dates - #3026
PLASMA-7942: add custom radiuses for selected range dates#3026TitanKuzmich wants to merge 3 commits into
Conversation
📝 WalkthroughWalkthroughCalendar components now support configurable grid row gaps, header arrow sizes, selected-item hover styles, and separate range-side radii. Theme configurations provide arrow sizes for supported component variants. Zero-length ranges no longer receive an endpoint side. ChangesCalendar token and selection styling
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Theme Builder app deployed! https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-3026/ |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/plasma-new-hope/src/components/Calendar/mixins/selected.ts`:
- Around line 109-114: Update the nested current-and-selected hover branch in
the selected styling mixin to also apply selectedCursorOnHover alongside
selectedBackgroundHover. Keep the existing behavior for non-current selected
items unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 850b1c49-1131-47ec-a3bb-b38a4d1e8e0a
📒 Files selected for processing (7)
packages/plasma-new-hope/src/components/Calendar/Calendar.tokens.tspackages/plasma-new-hope/src/components/Calendar/mixins/selected.tspackages/plasma-new-hope/src/components/Calendar/ui/DateStructureItem/DateStructureItem.styles.tspackages/plasma-new-hope/src/components/Calendar/ui/DateStructureItem/DateStructureItem.tsxpackages/plasma-new-hope/src/components/Calendar/utils/calendarRangeHelper.tspackages/plasma-new-hope/src/components/DatePicker/DatePicker.tokens.tspackages/plasma-new-hope/src/components/DatePicker/DatePickerBase.styles.ts
7641272 to
b2a44d4
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/plasma-new-hope/src/components/DateTimePicker/DateTimePicker.tokens.ts`:
- Around line 238-239: Update the custom-property names assigned to
calendarSelectedItemBackgroundHover and calendarSelectedItemHoverCursor in the
DateTimePicker token definitions to use the --plasma-date-time-picker-calendar__
namespace, matching the surrounding tokens and CalendarGrid.styles.ts consumer.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 66c62e7e-f88d-4bc5-b65f-0472f1144679
📒 Files selected for processing (76)
packages/plasma-b2c/src/components/Calendar/Calendar.config.tspackages/plasma-b2c/src/components/Calendar/CalendarDouble.config.tspackages/plasma-b2c/src/components/DatePicker/DatePicker.config.tspackages/plasma-b2c/src/components/DateTimePicker/DateTimePicker.config.tspackages/plasma-giga/src/components/Calendar/Calendar.config.tspackages/plasma-giga/src/components/Calendar/CalendarDouble.config.tspackages/plasma-giga/src/components/DatePicker/DatePicker.config.tspackages/plasma-giga/src/components/DateTimePicker/DateTimePicker.config.tspackages/plasma-homeds/src/components/Calendar/Calendar.config.tspackages/plasma-homeds/src/components/Calendar/CalendarDouble.config.tspackages/plasma-homeds/src/components/DatePicker/DatePicker.config.tspackages/plasma-homeds/src/components/DateTimePicker/DateTimePicker.config.tspackages/plasma-new-hope/src/components/Calendar/Calendar.tokens.tspackages/plasma-new-hope/src/components/Calendar/CalendarBase/CalendarBase.tsxpackages/plasma-new-hope/src/components/Calendar/CalendarDouble/CalendarDouble.tsxpackages/plasma-new-hope/src/components/Calendar/ui/CalendarDays/CalendarDays.styles.tspackages/plasma-new-hope/src/components/Calendar/ui/CalendarHeader/CalendarHeader.tsxpackages/plasma-new-hope/src/components/Calendar/ui/CalendarHeader/CalendarHeader.types.tspackages/plasma-new-hope/src/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.tspackages/plasma-new-hope/src/components/Calendar/ui/CalendarQuarters/CalendarQuarters.styles.tspackages/plasma-new-hope/src/components/Calendar/ui/CalendarYears/CalendarYears.styles.tspackages/plasma-new-hope/src/components/DatePicker/DatePicker.tokens.tspackages/plasma-new-hope/src/components/DatePicker/DatePickerBase.styles.tspackages/plasma-new-hope/src/components/DateTimePicker/DateTimePicker.tokens.tspackages/plasma-new-hope/src/components/DateTimePicker/ui/CalendarGrid/CalendarGrid.styles.tspackages/plasma-new-hope/src/components/_Icon/Icons/IconDisclosureDownFill.tsxpackages/plasma-web/src/components/Calendar/Calendar.config.tspackages/plasma-web/src/components/Calendar/CalendarDouble.config.tspackages/plasma-web/src/components/DatePicker/DatePicker.config.tspackages/plasma-web/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-bizcom/src/components/Calendar/Calendar.config.tspackages/sdds-bizcom/src/components/Calendar/CalendarDouble.config.tspackages/sdds-bizcom/src/components/DatePicker/DatePicker.config.tspackages/sdds-bizcom/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-cs/src/components/Calendar/Calendar.config.tspackages/sdds-cs/src/components/Calendar/CalendarDouble.config.tspackages/sdds-cs/src/components/DatePicker/DatePicker.config.tspackages/sdds-dfa/src/components/Calendar/Calendar.config.tspackages/sdds-dfa/src/components/Calendar/CalendarDouble.config.tspackages/sdds-dfa/src/components/DatePicker/DatePicker.config.tspackages/sdds-dfa/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-finai/src/components/Calendar/Calendar.config.tspackages/sdds-finai/src/components/Calendar/CalendarDouble.config.tspackages/sdds-finai/src/components/DatePicker/DatePicker.config.tspackages/sdds-finai/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-insol-next/src/components/Calendar/Calendar.config.tspackages/sdds-insol-next/src/components/Calendar/CalendarDouble.config.tspackages/sdds-insol-next/src/components/DatePicker/DatePicker.config.tspackages/sdds-insol-next/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-insol/src/components/Calendar/Calendar.config.tspackages/sdds-insol/src/components/Calendar/CalendarDouble.config.tspackages/sdds-insol/src/components/DatePicker/DatePicker.config.tspackages/sdds-insol/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-netology/src/components/Calendar/Calendar.config.tspackages/sdds-netology/src/components/Calendar/CalendarDouble.config.tspackages/sdds-netology/src/components/DatePicker/DatePicker.config.tspackages/sdds-netology/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-os/src/components/Calendar/Calendar.config.tspackages/sdds-os/src/components/Calendar/CalendarDouble.config.tspackages/sdds-os/src/components/DatePicker/DatePicker.config.tspackages/sdds-platform-ai/src/components/Calendar/CalendarBase.config.tspackages/sdds-platform-ai/src/components/Calendar/CalendarDouble.config.tspackages/sdds-platform-ai/src/components/DatePicker/DatePicker.config.tspackages/sdds-platform-ai/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-sbcom/src/components/Calendar/Calendar.config.tspackages/sdds-sbcom/src/components/Calendar/CalendarDouble.config.tspackages/sdds-sbcom/src/components/DatePicker/DatePicker.config.tspackages/sdds-sbcom/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-scan/src/components/Calendar/Calendar.config.tspackages/sdds-scan/src/components/Calendar/CalendarDouble.config.tspackages/sdds-scan/src/components/DatePicker/DatePicker.config.tspackages/sdds-scan/src/components/DateTimePicker/DateTimePicker.config.tspackages/sdds-serv/src/components/Calendar/Calendar.config.tspackages/sdds-serv/src/components/Calendar/CalendarDouble.config.tspackages/sdds-serv/src/components/DatePicker/DatePicker.config.tspackages/sdds-serv/src/components/DateTimePicker/DateTimePicker.config.ts
💤 Files with no reviewable changes (3)
- packages/plasma-new-hope/src/components/Calendar/CalendarDouble/CalendarDouble.tsx
- packages/plasma-new-hope/src/components/Calendar/CalendarBase/CalendarBase.tsx
- packages/plasma-new-hope/src/components/Calendar/ui/CalendarHeader/CalendarHeader.types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/plasma-new-hope/src/components/DatePicker/DatePicker.tokens.ts
- packages/plasma-new-hope/src/components/DatePicker/DatePickerBase.styles.ts
| calendarSelectedItemBackgroundHover: '--plasma-date-picker-calendar__selected-item-background-hover', | ||
| calendarSelectedItemHoverCursor: '--plasma-date-picker-calendar__selected-item-hover-cursor', |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Use the DateTimePicker namespace for these custom properties.
The surrounding tokens use --plasma-date-time-picker-calendar__..., but Lines 238-239 use the DatePicker namespace. The CalendarGrid.styles.ts consumer reads these values, so direct DateTimePicker custom-property overrides will not use the expected names. This also allows DatePicker and DateTimePicker styles to target the same variables.
Proposed fix
- calendarSelectedItemBackgroundHover: '--plasma-date-picker-calendar__selected-item-background-hover',
- calendarSelectedItemHoverCursor: '--plasma-date-picker-calendar__selected-item-hover-cursor',
+ calendarSelectedItemBackgroundHover: '--plasma-date-time-picker-calendar__selected-item-background-hover',
+ calendarSelectedItemHoverCursor: '--plasma-date-time-picker-calendar__selected-item-hover-cursor',📝 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.
| calendarSelectedItemBackgroundHover: '--plasma-date-picker-calendar__selected-item-background-hover', | |
| calendarSelectedItemHoverCursor: '--plasma-date-picker-calendar__selected-item-hover-cursor', | |
| calendarSelectedItemBackgroundHover: '--plasma-date-time-picker-calendar__selected-item-background-hover', | |
| calendarSelectedItemHoverCursor: '--plasma-date-time-picker-calendar__selected-item-hover-cursor', |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@packages/plasma-new-hope/src/components/DateTimePicker/DateTimePicker.tokens.ts`
around lines 238 - 239, Update the custom-property names assigned to
calendarSelectedItemBackgroundHover and calendarSelectedItemHoverCursor in the
DateTimePicker token definitions to use the --plasma-date-time-picker-calendar__
namespace, matching the surrounding tokens and CalendarGrid.styles.ts consumer.
Core
Calendar, DatePicker
What/why changed
Summary by CodeRabbit
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install @salutejs/plasma-asdk@0.387.0-canary.3026.31178180335.0 npm install @salutejs/plasma-b2c@1.629.0-canary.3026.31178180335.0 npm install @salutejs/plasma-colors@0.18.0-canary.3026.31178180335.0 npm install @salutejs/plasma-core@1.236.0-canary.3026.31178180335.0 npm install @salutejs/plasma-giga@0.356.0-canary.3026.31178180335.0 npm install @salutejs/plasma-homeds@0.356.0-canary.3026.31178180335.0 npm install @salutejs/plasma-hope@1.383.0-canary.3026.31178180335.0 npm install @salutejs/plasma-icons@1.245.0-canary.3026.31178180335.0 npm install @salutejs/plasma-new-hope@0.373.0-canary.3026.31178180335.0 npm install @salutejs/plasma-tokens@1.147.0-canary.3026.31178180335.0 npm install @salutejs/plasma-tokens-b2b@1.61.0-canary.3026.31178180335.0 npm install @salutejs/plasma-tokens-b2c@0.72.0-canary.3026.31178180335.0 npm install @salutejs/plasma-tokens-core@0.9.0-canary.3026.31178180335.0 npm install @salutejs/plasma-tokens-web@1.76.0-canary.3026.31178180335.0 npm install @salutejs/plasma-typo@0.49.0-canary.3026.31178180335.0 npm install @salutejs/plasma-web@1.631.0-canary.3026.31178180335.0 npm install @salutejs/sdds-bizcom@0.361.0-canary.3026.31178180335.0 npm install @salutejs/sdds-cs@0.365.0-canary.3026.31178180335.0 npm install @salutejs/sdds-dfa@0.359.0-canary.3026.31178180335.0 npm install @salutejs/sdds-finai@0.352.0-canary.3026.31178180335.0 npm install @salutejs/sdds-insol@0.356.0-canary.3026.31178180335.0 npm install @salutejs/sdds-insol-next@0.355.0-canary.3026.31178180335.0 npm install @salutejs/sdds-netology@0.360.0-canary.3026.31178180335.0 npm install @salutejs/sdds-os@0.31.0-canary.3026.31178180335.0 npm install @salutejs/sdds-platform-ai@0.360.0-canary.3026.31178180335.0 npm install @salutejs/sdds-sbcom@0.361.0-canary.3026.31178180335.0 npm install @salutejs/sdds-scan@0.359.0-canary.3026.31178180335.0 npm install @salutejs/sdds-serv@0.360.0-canary.3026.31178180335.0 npm install @salutejs/core-themes@0.37.0-canary.3026.31178180335.0 npm install @salutejs/plasma-themes@0.59.0-canary.3026.31178180335.0 npm install @salutejs/sdds-themes@0.74.0-canary.3026.31178180335.0 npm install @salutejs/sdds-api-tests@0.18.0-canary.3026.31178180335.0 npm install @salutejs/plasma-cy-utils@0.166.0-canary.3026.31178180335.0 npm install @salutejs/plasma-sb-utils@0.237.0-canary.3026.31178180335.0 npm install @salutejs/plasma-tokens-utils@0.57.0-canary.3026.31178180335.0 # or yarn add @salutejs/plasma-asdk@0.387.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-b2c@1.629.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-colors@0.18.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-core@1.236.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-giga@0.356.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-homeds@0.356.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-hope@1.383.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-icons@1.245.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-new-hope@0.373.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-tokens@1.147.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-tokens-b2b@1.61.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-tokens-b2c@0.72.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-tokens-core@0.9.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-tokens-web@1.76.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-typo@0.49.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-web@1.631.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-bizcom@0.361.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-cs@0.365.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-dfa@0.359.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-finai@0.352.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-insol@0.356.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-insol-next@0.355.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-netology@0.360.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-os@0.31.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-platform-ai@0.360.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-sbcom@0.361.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-scan@0.359.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-serv@0.360.0-canary.3026.31178180335.0 yarn add @salutejs/core-themes@0.37.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-themes@0.59.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-themes@0.74.0-canary.3026.31178180335.0 yarn add @salutejs/sdds-api-tests@0.18.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-cy-utils@0.166.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-sb-utils@0.237.0-canary.3026.31178180335.0 yarn add @salutejs/plasma-tokens-utils@0.57.0-canary.3026.31178180335.0