@ecohouse/ui 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/theme/colors.test.ts +22 -1
- package/src/theme/typography.ts +14 -14
package/package.json
CHANGED
package/src/theme/colors.test.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { colors } from "./colors";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
buttonTypography,
|
|
5
|
+
inputTypography,
|
|
6
|
+
segmentedToggleTypography,
|
|
7
|
+
selectTypography,
|
|
8
|
+
textareaTypography,
|
|
9
|
+
} from "./typography";
|
|
4
10
|
|
|
5
11
|
describe("design tokens", () => {
|
|
6
12
|
it("exposes primary and button typography used by Button", () => {
|
|
@@ -15,5 +21,20 @@ describe("design tokens", () => {
|
|
|
15
21
|
expect(colors.whiteAlpha5).toBe("#FFFFFF0D");
|
|
16
22
|
expect(buttonTypography.lg.fontSize).toBe(14);
|
|
17
23
|
expect(buttonTypography.lg.fontWeight).toBe("600");
|
|
24
|
+
expect(segmentedToggleTypography.fontSize).toBe(12);
|
|
25
|
+
expect(segmentedToggleTypography.lineHeight).toBe(12);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("keeps Input, Select, and Textarea field text aligned", () => {
|
|
29
|
+
const fieldTypography = {
|
|
30
|
+
fontSize: 12,
|
|
31
|
+
fontWeight: "400",
|
|
32
|
+
letterSpacing: 0.36,
|
|
33
|
+
lineHeight: 12,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
expect(inputTypography.field).toMatchObject(fieldTypography);
|
|
37
|
+
expect(selectTypography.field).toMatchObject(fieldTypography);
|
|
38
|
+
expect(textareaTypography.field).toMatchObject(fieldTypography);
|
|
18
39
|
});
|
|
19
40
|
});
|
package/src/theme/typography.ts
CHANGED
|
@@ -38,12 +38,12 @@ export const statCardTypography = {
|
|
|
38
38
|
letterSpacing: 0,
|
|
39
39
|
} as const;
|
|
40
40
|
|
|
41
|
-
/** Segmented toggle label — Medium
|
|
41
|
+
/** Segmented toggle label — Medium 12, line-height 100%, letter-spacing 0. */
|
|
42
42
|
export const segmentedToggleTypography = {
|
|
43
43
|
fontFamily: fonts.sans,
|
|
44
|
-
fontSize:
|
|
44
|
+
fontSize: 12,
|
|
45
45
|
fontWeight: "500" as const,
|
|
46
|
-
lineHeight:
|
|
46
|
+
lineHeight: 12,
|
|
47
47
|
letterSpacing: 0,
|
|
48
48
|
} as const;
|
|
49
49
|
|
|
@@ -117,10 +117,10 @@ export const inputTypography = {
|
|
|
117
117
|
},
|
|
118
118
|
field: {
|
|
119
119
|
fontFamily: fonts.sans,
|
|
120
|
-
fontSize:
|
|
120
|
+
fontSize: 12,
|
|
121
121
|
fontWeight: "400" as const,
|
|
122
|
-
lineHeight:
|
|
123
|
-
letterSpacing: 0,
|
|
122
|
+
lineHeight: 12,
|
|
123
|
+
letterSpacing: 0.36,
|
|
124
124
|
},
|
|
125
125
|
hint: {
|
|
126
126
|
fontFamily: fonts.sans,
|
|
@@ -131,7 +131,7 @@ export const inputTypography = {
|
|
|
131
131
|
},
|
|
132
132
|
} as const;
|
|
133
133
|
|
|
134
|
-
/** Select label / field / hint typography — Medium/Regular 12
|
|
134
|
+
/** Select label / field / hint typography — Medium/Regular 12, letter-spacing 3%. */
|
|
135
135
|
export const selectTypography = {
|
|
136
136
|
label: {
|
|
137
137
|
fontFamily: fonts.sans,
|
|
@@ -142,10 +142,10 @@ export const selectTypography = {
|
|
|
142
142
|
},
|
|
143
143
|
field: {
|
|
144
144
|
fontFamily: fonts.sans,
|
|
145
|
-
fontSize:
|
|
145
|
+
fontSize: 12,
|
|
146
146
|
fontWeight: "400" as const,
|
|
147
|
-
lineHeight:
|
|
148
|
-
letterSpacing: 0,
|
|
147
|
+
lineHeight: 12,
|
|
148
|
+
letterSpacing: 0.36,
|
|
149
149
|
},
|
|
150
150
|
hint: {
|
|
151
151
|
fontFamily: fonts.sans,
|
|
@@ -221,7 +221,7 @@ export const datePickerTypography = {
|
|
|
221
221
|
},
|
|
222
222
|
} as const;
|
|
223
223
|
|
|
224
|
-
/** Textarea label / field / hint typography — Medium/Regular 12
|
|
224
|
+
/** Textarea label / field / hint typography — Medium/Regular 12, letter-spacing 3%. */
|
|
225
225
|
export const textareaTypography = {
|
|
226
226
|
label: {
|
|
227
227
|
fontFamily: fonts.sans,
|
|
@@ -232,10 +232,10 @@ export const textareaTypography = {
|
|
|
232
232
|
},
|
|
233
233
|
field: {
|
|
234
234
|
fontFamily: fonts.sans,
|
|
235
|
-
fontSize:
|
|
235
|
+
fontSize: 12,
|
|
236
236
|
fontWeight: "400" as const,
|
|
237
|
-
lineHeight:
|
|
238
|
-
letterSpacing: 0,
|
|
237
|
+
lineHeight: 12,
|
|
238
|
+
letterSpacing: 0.36,
|
|
239
239
|
},
|
|
240
240
|
hint: {
|
|
241
241
|
fontFamily: fonts.sans,
|