Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions react/css/src/digitv2/components/buttonsV2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
padding-right: theme(digitv2.spacers.spacer6);
min-width: 6.5625rem;
min-height: theme(digitv2.spacers.spacer10);
border-radius: theme(digitv2.borderRadius.radius0);

h2 {
@extend .typography.button.large;
Expand All @@ -69,6 +70,7 @@
gap: theme(digitv2.spacers.spacer2);
min-width: 6.5625rem;
background-color: theme(digitv2.lightTheme.primary-1);
border-radius: theme(digitv2.borderRadius.radius0);

h2 {
@extend .typography.button.large;
Expand Down Expand Up @@ -130,6 +132,7 @@
min-width: 6.5625rem;
border: 0.063rem solid theme(digitv2.lightTheme.primary-1);
width: fit-content;
border-radius: theme(digitv2.borderRadius.radius0);

&:focus {
@apply outline-none;
Expand Down Expand Up @@ -199,6 +202,7 @@
padding-right: theme(digitv2.spacers.spacer0);
gap: theme(digitv2.spacers.spacer2);
min-width: 6.5625rem;
border-radius: theme(digitv2.borderRadius.radius0);

&:focus {
@apply outline-none;
Expand Down Expand Up @@ -258,6 +262,7 @@
padding-right: theme(digitv2.spacers.spacer0);
gap: theme(digitv2.spacers.spacer2);
min-width: 4.875rem;
border-radius: theme(digitv2.borderRadius.radius0);

&:focus {
@apply outline-none;
Expand Down
7 changes: 7 additions & 0 deletions react/css/src/digitv2/components/textInputV2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
color: theme(digitv2.lightTheme.text-primary);
line-height: theme(digitv2.spacers.spacer6);
border: 0.094rem solid theme(digitv2.lightTheme.alert-error);
border-radius: theme(digitv2.borderRadius.radius0);
}

.digit-text-input-field {
Expand Down Expand Up @@ -226,6 +227,7 @@
color: theme(digitv2.lightTheme.text-primary);
line-height: theme(digitv2.spacers.spacer6);
border: 0.094rem solid theme(digitv2.lightTheme.alert-error);
border-radius: theme(digitv2.borderRadius.radius0);
}

.digit-employeeCard-input {
Expand All @@ -238,6 +240,7 @@
border: 0.063rem solid theme(digitv2.lightTheme.text-secondary);
color: theme(digitv2.lightTheme.text-primary);
line-height: theme(digitv2.spacers.spacer6);
border-radius: theme(digitv2.borderRadius.radius0);
}

.digit-employeeCard-input:disabled {
Expand All @@ -264,6 +267,7 @@
color: theme(digitv2.lightTheme.text-primary);
line-height: theme(digitv2.spacers.spacer6);
border: 0.094rem solid theme(digitv2.lightTheme.alert-error);
border-radius: theme(digitv2.borderRadius.radius0);
}

.digit-inputWrapper {
Expand Down Expand Up @@ -322,6 +326,7 @@
border: 0.063rem solid theme(digitv2.lightTheme.text-secondary);
color: theme(digitv2.lightTheme.text-primary);
line-height: theme(digitv2.spacers.spacer6);
border-radius: theme(digitv2.borderRadius.radius0);
}

.digit-citizenCard-input--front {
Expand All @@ -344,6 +349,7 @@
color: theme(digitv2.lightTheme.text-primary);
line-height:theme(digitv2.spacers.spacer6);
border: 0.094rem solid theme(digitv2.lightTheme.alert-error);
border-radius: theme(digitv2.borderRadius.radius0);
}

.digit-card-inputError {
Expand All @@ -356,6 +362,7 @@
color: theme(digitv2.lightTheme.text-primary);
line-height: theme(digitv2.spacers.spacer6);
border: 0.094rem solid theme(digitv2.lightTheme.alert-error);
border-radius: theme(digitv2.borderRadius.radius0);
}


Expand Down
16 changes: 16 additions & 0 deletions react/css/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,22 @@ module.exports = {
spacer12:"3rem",
spacer13:"3.5rem"
},
borderRadius:{
radius0:"0rem",
radius1: "0.25rem",
radius2: "0.375rem",
radius3: "0.5rem",
radius4: "0.625rem",
radius5: "0.75rem",
radius6: "0.875rem",
radius7: "1rem",
radius8: "1.125rem",
radius9: "1.25rem",
radius10: "1.5rem",
radius11: "1.75rem",
radius12: "2rem",
radius13: "2.5rem"
},
divider: {
dividerS: "0.063rem solid #D6D5D4",
dividerM: "0.125rem solid #D6D5D4",
Expand Down
5 changes: 4 additions & 1 deletion react/ui-components/src/atoms/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const Button = (props) => {
};

const icon = IconRender();
const borderRadius = props?.borderRadius;

const formattedLabel = props?.label
? props?.variation === "link"
Expand Down Expand Up @@ -125,7 +126,7 @@ const Button = (props) => {
id={fieldId}
disabled={props?.isDisabled || null}
title={props?.title || ""}
style={props.style ? props.style : null}
style={props.style ? { borderRadius, ...props.style } : borderRadius ? { borderRadius } : undefined}
>
<div
id={`${fieldId}-content`}
Expand Down Expand Up @@ -211,6 +212,8 @@ Button.propTypes = {
* button size
*/
size: PropTypes.string,

borderRadius: PropTypes.string
};

Button.defaultProps = {
Expand Down
8 changes: 5 additions & 3 deletions react/ui-components/src/atoms/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const TextInput = (props) => {
} ${props.populators?.customIcon ? "withIcon" : ""}`;

const datePickerRef = useRef(null);

const borderRadius = props.borderRadius;
return (
<React.Fragment>
<div
Expand Down Expand Up @@ -284,6 +284,7 @@ const TextInput = (props) => {
? new Date(props?.populators?.max)
: undefined
}
style={props.style ? { borderRadius, ...props.style } : borderRadius ? { borderRadius } : undefined}
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 | 🟡 Minor

Fix style precedence: borderRadius prop should override style.borderRadius.

The current spread order allows props.style.borderRadius to override the explicit borderRadius prop, which is counterintuitive. When a developer passes a specific prop, it should take precedence over generic style object properties.

Apply this pattern instead:

-style={props.style ? { borderRadius, ...props.style } : borderRadius ? { borderRadius } : undefined}
+style={borderRadius ? { ...props.style, borderRadius } : props.style}

This ensures:

  • The borderRadius prop always takes precedence when provided
  • No unnecessary borderRadius: undefined in the style object
  • props.style is preserved when only style is provided
  • Cleaner conditional logic

Apply this change to all three occurrences (lines 287, 347, 431).

Also applies to: 347-347, 431-431

🤖 Prompt for AI Agents
In react/ui-components/src/atoms/TextInput.js around lines 287, 347, and 431,
the style spread currently places props.style after the explicit borderRadius
prop which lets props.style.borderRadius override the borderRadius prop; change
the merge order so the computed borderRadius value is applied last (i.e., spread
props.style first, then, if borderRadius is defined, set borderRadius) so the
borderRadius prop always wins, avoid adding borderRadius: undefined, and
preserve props.style when borderRadius is not provided.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@akhil-egov
The style prop already supports setting any styling properties for the button. Introducing a separate prop specifically for borderRadius doesn’t make sense — otherwise, we’d have to create individual props for color, text color, size, and so on. It’s better to avoid adding this additional prop since your logic would still merge under style.

You can simply achieve the same result using:
<Button style={{ borderRadius: "0.5rem" }} />

/>
<div
className={`digit-new-date-format ${
Expand Down Expand Up @@ -343,7 +344,7 @@ const TextInput = (props) => {
}}
ref={props.inputRef}
value={props?.value}
style={{ ...props.style }}
style={props.style ? { borderRadius, ...props.style } : borderRadius ? { borderRadius } : undefined}
defaultValue={props.defaultValue}
minLength={props.minlength}
maxLength={props.maxlength}
Expand Down Expand Up @@ -427,7 +428,7 @@ const TextInput = (props) => {
}}
ref={props.inputRef}
value={props?.value}
style={{ ...props.style }}
style={props.style ? { borderRadius, ...props.style } : borderRadius ? { borderRadius } : undefined}
defaultValue={props.defaultValue}
minLength={props.minlength}
maxLength={props.maxlength}
Expand Down Expand Up @@ -526,6 +527,7 @@ TextInput.propTypes = {
errors: PropTypes.object,
config: PropTypes.object,
error: PropTypes.string,
borderRadius: PropTypes.string
};

TextInput.defaultProps = {
Expand Down