Add new Icon parameters to BitTimePicker (#12096)#12097
Add new Icon parameters to BitTimePicker (#12096)#12097msynk merged 1 commit intobitfoundation:developfrom
Conversation
WalkthroughThe BitTimePicker component is enhanced to support external icon libraries through new icon customization parameters. The changes introduce BitIconInfo and IconName properties for controlling icons across the component (main input, increase/decrease hour/minute buttons, and close button) while maintaining backward compatibility through nullable defaults. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/TimePicker/BitTimePickerDemo.razor`:
- Around line 193-194: The demo text in BitTimePickerDemo.razor's DemoExample
(Id="example13", RazorCode="@example13RazorCode") claims support for "Material
Icons" but the example13RazorCode only shows FontAwesome and Bootstrap Icons;
either add a Material Icons example to example13RazorCode (showing how to set
Icon parameter to a Material icon class or SVG) or remove "Material Icons" from
the descriptive string inside the DemoExample to keep the text consistent with
the rendered examples.
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/TimePicker/BitTimePickerDemo.razor.cs`:
- Around line 163-197: The documented default values for IncreaseHourIconName
and IncreaseMinuteIconName in BitTimePicker demo are incomplete: they list
"ChevronDownSmall" but the actual effective fallback used in BitTimePicker.razor
includes a rotation CSS class ("ChevronDownSmall bit-ico-r180"); update the
documentation entries for the properties IncreaseHourIconName and
IncreaseMinuteIconName to reflect the full effective default (e.g.,
"ChevronDownSmall bit-ico-r180") or add a parenthetical note that the increase
icons include the rotation modifier applied by BitTimePicker.razor so the demo's
DefaultValue and Description match the component behavior.
🧹 Nitpick comments (1)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/TimePicker/BitTimePicker.razor (1)
4-10: CSS modifier class embedded in icon name defaults is a fragile pattern.Lines 5 and 7 embed
bit-ico-r180(a rotation modifier) inside the icon name string:"ChevronDownSmall bit-ico-r180". TheBitIconInfo.From()method passes this entire string as the Name property toBitIconInfo.Bit(), which generatesbit-icon bit-icon--ChevronDownSmall bit-ico-r180fromGetCssClasses(). The space separates the classes correctly, but this creates implicit coupling—users providing a customIncreaseHourIconNameorIncreaseMinuteIconNamewon't automatically get the rotation applied. This pattern is used consistently across BitTimePicker, BitNumberField, and BitMessage, but leaves rotation as a default-only feature rather than a composable modifier.
...ent/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/TimePicker/BitTimePickerDemo.razor
Show resolved
Hide resolved
.../Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/TimePicker/BitTimePickerDemo.razor.cs
Show resolved
Hide resolved
|


closes #12096
Summary by CodeRabbit
New Features
Documentation