Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit fd12bc2

Browse files
lekoafboilund
authored andcommitted
chore: export designparams as const
Exports all designparams as const for easier hinting of what's included in `spacing`, `componentSize` etc.
1 parent 51b7062 commit fd12bc2

File tree

1 file changed

+10
-76
lines changed

1 file changed

+10
-76
lines changed

packages/core/src/designparams.ts

Lines changed: 10 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -6,108 +6,42 @@
66
* as components are built to conform to these properties.
77
*/
88

9-
interface Spacing {
10-
readonly extraSmall: '2px'
11-
readonly small: '4px'
12-
readonly medium: '8px'
13-
readonly large: '16px'
14-
readonly extraLarge: '24px'
15-
readonly huge: '32px'
16-
}
17-
/**
18-
* Spacing
19-
* @extraSmall '2px',
20-
* @small '4px',
21-
* @medium '8px',
22-
* @large '16px',
23-
* @extraLarge '24px',
24-
* @huge '32px',
25-
*/
26-
export const spacing: Spacing = {
9+
export const spacing = {
2710
extraSmall: '2px',
2811
small: '4px',
2912
medium: '8px',
3013
large: '16px',
3114
extraLarge: '24px',
3215
huge: '32px',
33-
}
16+
} as const
3417

35-
interface Radius {
36-
readonly circle: '50%'
37-
readonly small: '2px'
38-
readonly medium: '4px'
39-
readonly large: '8px'
40-
}
41-
interface Shape {
42-
readonly radius: Radius
43-
}
44-
/**
45-
* Basic shapes
46-
*/
47-
export const shape: Shape = {
18+
export const shape = {
4819
radius: {
4920
circle: '50%',
5021
small: '2px',
5122
medium: '4px',
5223
large: '8px',
5324
},
54-
}
25+
} as const
5526

56-
interface ComponentSize {
57-
readonly mini: '24px'
58-
readonly small: '32px'
59-
readonly medium: '40px'
60-
readonly large: '48px'
61-
readonly extraLarge: '56px'
62-
}
63-
/**
64-
* Component size
65-
* @mini '24px',
66-
* @small '32px',
67-
* @medium '40px',
68-
* @large '48px',
69-
* @extraLarge '56px',
70-
*/
71-
export const componentSize: ComponentSize = {
27+
export const componentSize = {
7228
mini: '24px',
7329
small: '32px',
7430
medium: '40px',
7531
large: '48px',
7632
extraLarge: '56px',
77-
}
33+
} as const
7834

79-
interface Iconsize {
80-
readonly small: '16px'
81-
readonly medium: '24px'
82-
readonly large: '40px'
83-
readonly extraLarge: '80px'
84-
}
85-
/**
86-
* Icon size
87-
* @small '16px',
88-
* @medium '24px',
89-
* @large '40px',
90-
* @extraLarge '80px',
91-
*/
92-
export const iconSize: Iconsize = {
35+
export const iconSize = {
9336
small: '16px',
9437
medium: '24px',
9538
large: '40px',
9639
extraLarge: '80px',
97-
}
40+
} as const
9841

99-
interface Opacity {
100-
readonly 16: 0.16
101-
readonly 24: 0.24
102-
readonly 40: 0.4
103-
readonly 48: 0.48
104-
}
105-
/**
106-
* Opacities
107-
*/
108-
export const opacity: Opacity = {
42+
export const opacity = {
10943
16: 0.16,
11044
24: 0.24,
11145
40: 0.4,
11246
48: 0.48,
113-
}
47+
} as const

0 commit comments

Comments
 (0)