Skip to content

Commit a0b987a

Browse files
authored
feat(feedback): Configure feedback border radius (#10289)
Adds ability to configure all border radiuses on feedback widget Closes #10256
1 parent 62b0c4d commit a0b987a

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

packages/feedback/src/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const LIGHT_THEME = {
1616
backgroundHover: '#f6f6f7',
1717
foreground: '#2b2233',
1818
border: '1.5px solid rgba(41, 35, 47, 0.13)',
19+
borderRadius: '12px',
1920
boxShadow: '0px 4px 24px 0px rgba(43, 34, 51, 0.12)',
2021

2122
success: '#268d75',
@@ -39,6 +40,9 @@ const LIGHT_THEME = {
3940
inputForeground: INHERIT,
4041
inputBorder: 'var(--border)',
4142
inputOutlineFocus: SUBMIT_COLOR,
43+
44+
formBorderRadius: '20px',
45+
formContentBorderRadius: '6px',
4246
};
4347

4448
export const DEFAULT_THEME = {

packages/feedback/src/types/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ export interface FeedbackTheme {
215215
* Border styling for actor and dialog
216216
*/
217217
border: string;
218+
/**
219+
* Border radius styling for actor
220+
*/
221+
borderRadius: string;
218222
/**
219223
* Box shadow for actor and dialog
220224
*/
@@ -299,6 +303,14 @@ export interface FeedbackTheme {
299303
* Border styles for form inputs when focused
300304
*/
301305
inputOutlineFocus: string;
306+
/**
307+
* Border radius for dialog
308+
*/
309+
formBorderRadius: string;
310+
/**
311+
* Border radius for form inputs
312+
*/
313+
formContentBorderRadius: string;
302314
}
303315

304316
export interface FeedbackThemes {

packages/feedback/src/widget/Actor.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function createActorStyles(d: Document): HTMLStyleElement {
1111
align-items: center;
1212
gap: 8px;
1313
14-
border-radius: 12px;
14+
border-radius: var(--border-radius);
1515
cursor: pointer;
1616
font-size: 14px;
1717
font-weight: 600;

packages/feedback/src/widget/Dialog.css.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function createDialogStyles(d: Document): HTMLStyleElement {
3838
top: var(--top);
3939
4040
border: var(--border);
41-
border-radius: 20px;
41+
border-radius: var(--form-border-radius);
4242
background-color: var(--background);
4343
color: var(--foreground);
4444
@@ -113,7 +113,7 @@ export function createDialogStyles(d: Document): HTMLStyleElement {
113113
background-color: var(--input-background);
114114
box-sizing: border-box;
115115
border: var(--input-border);
116-
border-radius: 6px;
116+
border-radius: var(--form-content-border-radius);
117117
color: var(--input-foreground);
118118
font-size: 14px;
119119
font-weight: 500;
@@ -138,7 +138,7 @@ export function createDialogStyles(d: Document): HTMLStyleElement {
138138
.btn {
139139
line-height: inherit;
140140
border: var(--cancel-border);
141-
border-radius: 6px;
141+
border-radius: var(--form-content-border-radius);
142142
cursor: pointer;
143143
font-size: 14px;
144144
font-weight: 600;
@@ -178,7 +178,7 @@ export function createDialogStyles(d: Document): HTMLStyleElement {
178178
.success-message {
179179
background-color: var(--background);
180180
border: var(--border);
181-
border-radius: 12px;
181+
border-radius: var(--border-radius);
182182
box-shadow: var(--box-shadow);
183183
font-weight: 600;
184184
color: var(--success);

packages/feedback/src/widget/Main.css.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function getThemedCssVariables(theme: FeedbackTheme): string {
88
--error: ${theme.error};
99
--success: ${theme.success};
1010
--border: ${theme.border};
11+
--border-radius: ${theme.borderRadius};
1112
--box-shadow: ${theme.boxShadow};
1213
1314
--submit-background: ${theme.submitBackground};
@@ -28,6 +29,9 @@ function getThemedCssVariables(theme: FeedbackTheme): string {
2829
--input-foreground: ${theme.inputForeground};
2930
--input-border: ${theme.inputBorder};
3031
--input-outline-focus: ${theme.inputOutlineFocus};
32+
33+
--form-border-radius: ${theme.formBorderRadius};
34+
--form-content-border-radius: ${theme.formContentBorderRadius};
3135
`;
3236
}
3337

0 commit comments

Comments
 (0)