Skip to content

Commit 8fdd3f3

Browse files
authored
feat: allow styling of font family and letter spacing (#113)
* feat: allow styling of font family * feat: allow styling of letter spacing
1 parent d77e3ef commit 8fdd3f3

File tree

6 files changed

+25
-1
lines changed

6 files changed

+25
-1
lines changed

pages/chat-bubble/style-permutations.page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const styles = [
3636
paddingBlock: "20px",
3737
paddingInline: "30px",
3838
rowGap: "20px",
39+
fontFamily: "cursive",
40+
letterSpacing: "1px",
3941
},
4042
},
4143
];

src/__tests__/__snapshots__/documenter.test.ts.snap

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ Refer to the [style](/components/chat-bubble/?tabId=style) tab for more details.
257257
"optional": true,
258258
"type": "string",
259259
},
260+
{
261+
"name": "fontFamily",
262+
"optional": true,
263+
"type": "string",
264+
},
260265
{
261266
"name": "fontSize",
262267
"optional": true,
@@ -267,6 +272,11 @@ Refer to the [style](/components/chat-bubble/?tabId=style) tab for more details.
267272
"optional": true,
268273
"type": "string",
269274
},
275+
{
276+
"name": "letterSpacing",
277+
"optional": true,
278+
"type": "string",
279+
},
270280
{
271281
"name": "paddingBlock",
272282
"optional": true,
@@ -287,7 +297,7 @@ Refer to the [style](/components/chat-bubble/?tabId=style) tab for more details.
287297
},
288298
"name": "bubble",
289299
"optional": true,
290-
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; color?: string | undefined; ... 4 more ...; paddingInline?: string | undefined; }",
300+
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; color?: string | undefined; ... 6 more ...; paddingInline?: string | undefined; }",
291301
},
292302
{
293303
"inlineType": {

src/chat-bubble/__tests__/__snapshots__/style.test.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ exports[`getBubbleStyle > handles all possible style configurations 1`] = `
99
"borderWidth": undefined,
1010
"boxShadow": undefined,
1111
"color": undefined,
12+
"fontFamily": undefined,
1213
"fontSize": undefined,
1314
"fontWeight": undefined,
15+
"letterSpacing": undefined,
1416
"paddingBlock": undefined,
1517
"paddingInline": undefined,
1618
"rowGap": undefined,
@@ -26,8 +28,10 @@ exports[`getBubbleStyle > handles all possible style configurations 2`] = `
2628
"borderWidth": undefined,
2729
"boxShadow": undefined,
2830
"color": undefined,
31+
"fontFamily": undefined,
2932
"fontSize": undefined,
3033
"fontWeight": undefined,
34+
"letterSpacing": undefined,
3135
"paddingBlock": undefined,
3236
"paddingInline": undefined,
3337
"rowGap": undefined,
@@ -43,8 +47,10 @@ exports[`getBubbleStyle > handles all possible style configurations 3`] = `
4347
"borderWidth": "2px",
4448
"boxShadow": "0 4px 8px rgba(0,0,0,0.2)",
4549
"color": "#333",
50+
"fontFamily": "Arial, sans-serif",
4651
"fontSize": "16px",
4752
"fontWeight": "500",
53+
"letterSpacing": "0.5px",
4854
"paddingBlock": "20px",
4955
"paddingInline": "24px",
5056
"rowGap": "12px",

src/chat-bubble/__tests__/style.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ const allStyles = {
1919
borderWidth: "2px",
2020
boxShadow: "0 4px 8px rgba(0,0,0,0.2)",
2121
color: "#333",
22+
fontFamily: "Arial, sans-serif",
2223
fontSize: "16px",
2324
fontWeight: "500",
25+
letterSpacing: "0.5px",
2426
rowGap: "12px",
2527
paddingBlock: "20px",
2628
paddingInline: "24px",

src/chat-bubble/interfaces.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ export namespace ChatBubbleProps {
5353
borderWidth?: string;
5454
boxShadow?: string;
5555
color?: string;
56+
fontFamily?: string;
5657
fontSize?: string;
5758
fontWeight?: string;
59+
letterSpacing?: string;
5860
rowGap?: string;
5961
paddingBlock?: string;
6062
paddingInline?: string;

src/chat-bubble/style.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ export function getBubbleStyle(style: ChatBubbleProps.Style | undefined) {
2626
borderWidth: style?.bubble?.borderWidth,
2727
boxShadow: style?.bubble?.boxShadow,
2828
color: style?.bubble?.color,
29+
fontFamily: style?.bubble?.fontFamily,
2930
fontSize: style?.bubble?.fontSize,
3031
fontWeight: style?.bubble?.fontWeight,
32+
letterSpacing: style?.bubble?.letterSpacing,
3133
paddingBlock: style?.bubble?.paddingBlock,
3234
paddingInline: style?.bubble?.paddingInline,
3335
rowGap: style?.bubble?.rowGap,

0 commit comments

Comments
 (0)