bonkers-ui 1.0.7 → 1.0.8
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/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { EColors } from "../../_types/colors";
|
|
2
|
+
|
|
3
|
+
type Ran<T extends number> = number extends T ? number :_Range<T, []>;
|
|
4
|
+
type _Range<T extends number, R extends unknown[]> = R["length"] extends T ? R[number] : _Range<T, [R["length"], ...R]>;
|
|
5
|
+
|
|
6
|
+
export type TBerPropNumber = Ran<typeof berRankDictionary.length>
|
|
7
|
+
export type TBerPropString = `${TBerPropNumber}`;
|
|
8
|
+
export type TBerRank = typeof berRankDictionary[TBerPropNumber]["text"];
|
|
9
|
+
|
|
10
|
+
export const berRankDictionary = [
|
|
11
|
+
{
|
|
12
|
+
text: "N/A",
|
|
13
|
+
color: EColors.SECONDARY_ALT,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
text: "G",
|
|
17
|
+
color: EColors.ERROR,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
text: "F",
|
|
21
|
+
color: EColors.WARNING,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
text: "E2",
|
|
25
|
+
color: EColors.WARNING_600,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
text: "E1",
|
|
29
|
+
color: EColors.WARNING_600,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
text: "D2",
|
|
33
|
+
color: EColors.WARNING_400,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: "D1",
|
|
37
|
+
color: EColors.WARNING_400,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
text: "C3",
|
|
41
|
+
color: EColors.PRIMARY_ALT,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: "C2",
|
|
45
|
+
color: EColors.PRIMARY_ALT,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: "C1",
|
|
49
|
+
color: EColors.PRIMARY_ALT,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
text: "B3",
|
|
53
|
+
color: EColors.PRIMARY_ALT_600,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
text: "B2",
|
|
57
|
+
color: EColors.PRIMARY_ALT_600,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
text: "B1",
|
|
61
|
+
color: EColors.PRIMARY_ALT_600,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
text: "A3",
|
|
65
|
+
color: EColors.PRIMARY_ALT_700,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
text: "A2",
|
|
69
|
+
color: EColors.PRIMARY_ALT_700,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
text: "A1",
|
|
73
|
+
color: EColors.PRIMARY_ALT_700,
|
|
74
|
+
},
|
|
75
|
+
] as const;
|
|
76
|
+
|
|
77
|
+
export const berRanksList = berRankDictionary.map(({ text }) => text);
|
|
@@ -56,83 +56,11 @@
|
|
|
56
56
|
<script lang="ts" setup>
|
|
57
57
|
import UiTypography, { ETextWeight, ETypographySizes, ETextTransform } from "../ui-typography";
|
|
58
58
|
import { EColors } from "../../_types/colors";
|
|
59
|
-
|
|
60
|
-
type Ran<T extends number> = number extends T ? number :_Range<T, []>;
|
|
61
|
-
type _Range<T extends number, R extends unknown[]> = R["length"] extends T ? R[number] : _Range<T, [R["length"], ...R]>;
|
|
62
|
-
|
|
63
|
-
type TPropNumber = Ran<typeof berRankDictionary.length>
|
|
64
|
-
type TPropString = `${TPropNumber}`;
|
|
59
|
+
import { berRankDictionary, type TBerPropNumber, type TBerPropString }from"./_types";
|
|
65
60
|
|
|
66
61
|
defineProps<{
|
|
67
|
-
rank:
|
|
62
|
+
rank: TBerPropNumber | TBerPropString | number; // from 0 to 15
|
|
68
63
|
}>();
|
|
69
|
-
|
|
70
|
-
const berRankDictionary = [
|
|
71
|
-
{
|
|
72
|
-
text: "N/A",
|
|
73
|
-
color: EColors.SECONDARY_ALT,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
text: "G",
|
|
77
|
-
color: EColors.ERROR,
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
text: "F",
|
|
81
|
-
color: EColors.WARNING,
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
text: "E2",
|
|
85
|
-
color: EColors.WARNING_600,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
text: "E1",
|
|
89
|
-
color: EColors.WARNING_600,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
text: "D2",
|
|
93
|
-
color: EColors.WARNING_400,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
text: "D1",
|
|
97
|
-
color: EColors.WARNING_400,
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
text: "C3",
|
|
101
|
-
color: EColors.PRIMARY_ALT,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
text: "C2",
|
|
105
|
-
color: EColors.PRIMARY_ALT,
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
text: "C1",
|
|
109
|
-
color: EColors.PRIMARY_ALT,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
text: "B3",
|
|
113
|
-
color: EColors.PRIMARY_ALT_600,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
text: "B2",
|
|
117
|
-
color: EColors.PRIMARY_ALT_600,
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
text: "B1",
|
|
121
|
-
color: EColors.PRIMARY_ALT_600,
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
text: "A3",
|
|
125
|
-
color: EColors.PRIMARY_ALT_700,
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
text: "A2",
|
|
129
|
-
color: EColors.PRIMARY_ALT_700,
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
text: "A1",
|
|
133
|
-
color: EColors.PRIMARY_ALT_700,
|
|
134
|
-
},
|
|
135
|
-
] as const;
|
|
136
64
|
</script>
|
|
137
65
|
|
|
138
66
|
<style>
|
|
@@ -53,6 +53,18 @@
|
|
|
53
53
|
z-index: 1;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
input[type="range"]::-moz-range-thumb {
|
|
57
|
+
appearance: none;
|
|
58
|
+
background-color: var(--color-primary);
|
|
59
|
+
height: 13px;
|
|
60
|
+
width: 13px;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
border: var(--xs) solid var(--color-white);
|
|
63
|
+
box-shadow: 0 0 0 4px var(--color-primary);
|
|
64
|
+
box-sizing: content-box;
|
|
65
|
+
z-index: 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
56
68
|
.ui-input-range__line {
|
|
57
69
|
top: 50%;
|
|
58
70
|
transform: translate3d(0, -50%, 0);
|