-
Notifications
You must be signed in to change notification settings - Fork 1
feat(pds-input): add highlight prop and styling #567
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
Conversation
✅ Deploy Preview for pine-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@cameronsimony @kajabi-chris, you can use the Deploy Preview link above to see the updates. |
📝 WalkthroughWalkthroughA new Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
libs/core/src/components/pds-input/stories/pds-input.stories.js (1)
154-177: Consider using BaseTemplate to eliminate code duplication.The Highlight story duplicates the entire template structure instead of reusing
BaseTemplate.bind({}). This creates maintenance burden and is inconsistent with other feature stories likeDisabled,Readonly, andInvalid, which all useBaseTemplate.While the prefix icon demonstrates highlight styling on icons, this could be shown through the existing
withPrefixIconstory (which already has the.highlightbinding added at line 187) by enabling the highlight control in Storybook.Consider refactoring to:
-export const Highlight = (args) => html`<pds-input - autocomplete="${args.autocomplete}" - component-id="pds-input-highlight-example" - debounce="${args.debounce}" - ?disabled=${args.disabled} - error-message="${args.errorMessage}" - ?full-width=${args.fullWidth} - helper-message="${args.helperMessage}" - ?hide-label=${args.hideLabel} - .highlight=${args.highlight} - ?invalid=${args.invalid} - label="${args.label || 'Label'}" - name="${args.name}" - placeholder="${args.placeholder}" - ?readonly=${args.readonly} - ?required=${args.required} - type="${args.type || 'text'}" - value="${args.value}"> - <pds-icon slot="prefix" name="mail" size="small"></pds-icon> -</pds-input>`; +export const Highlight = BaseTemplate.bind({}); Highlight.args = { + componentId: 'pds-input-highlight-example', highlight: true, + label: 'Email', + type: 'text', value: 'This input is highlighted', };If demonstrating icon styling is essential, consider creating a separate
HighlightWithIconstory or adding a note in the documentation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
libs/core/src/components.d.ts(58 hunks)libs/core/src/components/pds-input/docs/pds-input.mdx(1 hunks)libs/core/src/components/pds-input/pds-input.scss(1 hunks)libs/core/src/components/pds-input/pds-input.tsx(1 hunks)libs/core/src/components/pds-input/readme.md(1 hunks)libs/core/src/components/pds-input/stories/pds-input.stories.js(13 hunks)libs/core/src/components/pds-input/test/pds-input.e2e.ts(1 hunks)libs/core/src/components/pds-input/test/pds-input.spec.tsx(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Cursor Bugbot
- GitHub Check: Cycode: Vulnerable Dependencies
- GitHub Check: Cycode: Vulnerable Dependencies
🔇 Additional comments (3)
libs/core/src/components/pds-input/stories/pds-input.stories.js (3)
15-15: LGTM!The
highlightprop is correctly added to the default args with afalsedefault value, consistent with other boolean props in the component.
59-60: LGTM!The
.highlightproperty binding is correctly implemented using Lit's property binding syntax, which properly passes the boolean value rather than a string attribute.
187-187: LGTM!The
.highlightbinding has been consistently added to all story templates, ensuring that the highlight control works across all story variants. This follows the established pattern for other props and allows users to test highlight in combination with various slot configurations.Also applies to: 207-207, 229-229, 253-253, 275-275, 299-299, 321-321, 346-346, 373-373, 395-395
libs/core/src/components/pds-input/stories/pds-input.stories.js
Outdated
Show resolved
Hide resolved
QuintonJason
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go
|
Thanks @pixelflips! I'm sure this is a constraint of the Pine preview, but, I was curious if I should see the tint change to the default state when I modify anything in the field? |
@kajabi-chris great question. it is indeed a limitation of storybook. engineers will need to implement the functionality and remove/reset the highlight prop on their side when the input is interacted with. you can toggle the highlight toggle in storybook to get the idea of them settting it to true/false. let me know if that helps. |
Description
Adds a
highlightboolean prop topds-inputthat applies purple accent styling to draw attention to important fields.What it does:
Why:
Provides a visual way to emphasize important input fields without overriding critical user feedback states.
Fixes: https://kajabi.atlassian.net/browse/DSS-1562
Type of change
How Has This Been Tested?
Test coverage:
reflect: true)Test Configuration:
Checklist:
If not applicable, leave options unchecked.