@appartmint/mint 0.14.14 → 0.15.0
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/css/mint.css +73 -43
- package/dist/css/mint.css.map +1 -1
- package/dist/css/mint.min.css +1 -1
- package/dist/css/mint.min.css.map +1 -1
- package/dist/js/imports/util/list.d.ts +11 -1
- package/dist/js/imports/util/list.d.ts.map +1 -1
- package/dist/js/imports/util/object.d.ts +9 -1
- package/dist/js/imports/util/object.d.ts.map +1 -1
- package/dist/js/imports/util/text.d.ts +4 -0
- package/dist/js/imports/util/text.d.ts.map +1 -1
- package/dist/js/index.js +43 -3
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.min.js +1 -1
- package/dist/js/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/scss/imports/components/_buttons.scss +5 -0
- package/src/scss/imports/components/_cards.scss +1 -0
- package/src/scss/imports/global/_global.scss +4 -10
- package/src/scss/imports/global/_text.scss +5 -1
- package/src/scss/imports/util/_vars.scss +9 -0
- package/src/ts/imports/util/list.ts +21 -1
- package/src/ts/imports/util/object.ts +28 -11
- package/src/ts/imports/util/text.ts +9 -0
|
@@ -37,7 +37,11 @@ p {
|
|
|
37
37
|
@each $tag in map-keys($font-size-mobile) {
|
|
38
38
|
#{$tag}, #{class($tag)} {
|
|
39
39
|
margin: 1rem 0;
|
|
40
|
-
font-size: map-get($font-size-mobile, $tag);
|
|
40
|
+
font-size: min(map-get($font-size-tiny, $tag), map-get($font-size-mobile, $tag));
|
|
41
|
+
|
|
42
|
+
@include break(xs) {
|
|
43
|
+
font-size: map-get($font-size-mobile, $tag);
|
|
44
|
+
}
|
|
41
45
|
|
|
42
46
|
@include break(md) {
|
|
43
47
|
font-size: map-get($font-size-desktop, $tag);
|
|
@@ -56,6 +56,15 @@ $font-secondary-backups: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
|
56
56
|
$font-height: 1.25 !default;
|
|
57
57
|
|
|
58
58
|
/// Font Sizes
|
|
59
|
+
$font-size-tiny: (
|
|
60
|
+
h1: 15vw,
|
|
61
|
+
h2: 12vw,
|
|
62
|
+
h3: 10vw,
|
|
63
|
+
h4: 8vw,
|
|
64
|
+
h5: 7vw,
|
|
65
|
+
h6: 6vw,
|
|
66
|
+
p: 1rem,
|
|
67
|
+
) !default;
|
|
59
68
|
$font-size-mobile: (
|
|
60
69
|
h1: 2.5rem,
|
|
61
70
|
h2: 2rem,
|
|
@@ -7,7 +7,7 @@ export abstract class mintList {
|
|
|
7
7
|
* @param list - the list to shuffle
|
|
8
8
|
* @returns - the shuffled list
|
|
9
9
|
*/
|
|
10
|
-
static
|
|
10
|
+
static shuffleCopy (list: any[]): any[] {
|
|
11
11
|
let copy = [...list];
|
|
12
12
|
for (let i = copy.length - 1; i > 0; i--) {
|
|
13
13
|
const j = Math.floor(Math.random() * (i + 1));
|
|
@@ -15,5 +15,25 @@ export abstract class mintList {
|
|
|
15
15
|
}
|
|
16
16
|
return copy;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Filters the array in place based on a test condition and returns the filtered array.
|
|
21
|
+
* This method modifies the original array by removing elements that do not pass the test implemented by the provided function.
|
|
22
|
+
*
|
|
23
|
+
* @template T The type of elements in the array.
|
|
24
|
+
* @param {T[]} list The array to filter, which will be modified in place.
|
|
25
|
+
* @param {(item: T) => boolean} test A function that tests each element of the array. Return `true` to keep the element, `false` otherwise.
|
|
26
|
+
* @returns {T[]} The original array with only the elements that passed the test.
|
|
27
|
+
*/
|
|
28
|
+
static filter<T> (list: T[], test: (item: T) => boolean): T[] {
|
|
29
|
+
let newLength = 0;
|
|
30
|
+
for (let i = 0; i < list.length; i++) {
|
|
31
|
+
if (test(list[i])) {
|
|
32
|
+
list[newLength++] = list[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
list.length = newLength;
|
|
36
|
+
return list;
|
|
37
|
+
}
|
|
18
38
|
};
|
|
19
39
|
export default mintList;
|
|
@@ -17,7 +17,7 @@ export abstract class mintObject {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
return isSimilar;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Returns true if the first object has at least the same
|
|
@@ -55,7 +55,7 @@ export abstract class mintObject {
|
|
|
55
55
|
isSuperset = isSuperset && mintObject.isSuperset(superset[key], subset[key]);
|
|
56
56
|
});
|
|
57
57
|
return isSuperset;
|
|
58
|
-
}
|
|
58
|
+
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Removes object entries by key
|
|
@@ -65,7 +65,7 @@ export abstract class mintObject {
|
|
|
65
65
|
*/
|
|
66
66
|
static remove (object: any, keys: string[]) : Object {
|
|
67
67
|
return this.removeKeys(object, keys);
|
|
68
|
-
}
|
|
68
|
+
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Removes object entries by key
|
|
@@ -79,7 +79,7 @@ export abstract class mintObject {
|
|
|
79
79
|
}
|
|
80
80
|
return obj;
|
|
81
81
|
}, {});
|
|
82
|
-
}
|
|
82
|
+
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Removes object entries by value
|
|
@@ -91,24 +91,41 @@ export abstract class mintObject {
|
|
|
91
91
|
}
|
|
92
92
|
return obj;
|
|
93
93
|
}, {});
|
|
94
|
-
}
|
|
94
|
+
}
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Sorts an object's entries alphabetically by key
|
|
98
98
|
*/
|
|
99
|
-
static sort (object: any) :
|
|
100
|
-
return
|
|
99
|
+
static sort (object: any, compareFn?: (a: string, b: string) => number) : any {
|
|
100
|
+
return this.sortKeys(object, compareFn);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Sorts an object's entries alphabetically by key
|
|
105
|
+
*/
|
|
106
|
+
static sortKeys (object: any, compareFn?: (a: string, b: string) => number) : any {
|
|
107
|
+
return Object.keys(object).sort(compareFn).reduce((obj: any, key: string) => {
|
|
101
108
|
obj[key] = object[key];
|
|
102
109
|
return obj;
|
|
103
110
|
}, {});
|
|
104
|
-
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Sorts an object's entries alphabetically by value
|
|
115
|
+
*/
|
|
116
|
+
static sortValues (object: any, compareFn: (a: any, b: any) => number) : any {
|
|
117
|
+
return Object.keys(object).sort((a: string, b: string) => compareFn(object[a], object[b])).reduce((obj: any, key: string) => {
|
|
118
|
+
obj[key] = object[key];
|
|
119
|
+
return obj;
|
|
120
|
+
}, {});
|
|
121
|
+
}
|
|
105
122
|
|
|
106
123
|
/**
|
|
107
124
|
* @alias mintObject.filterKeys
|
|
108
125
|
*/
|
|
109
126
|
static filter (object: any, keys: string[]) : Object {
|
|
110
127
|
return this.filterKeys(object, keys);
|
|
111
|
-
}
|
|
128
|
+
}
|
|
112
129
|
|
|
113
130
|
/**
|
|
114
131
|
* Filters an object by its keys
|
|
@@ -121,7 +138,7 @@ export abstract class mintObject {
|
|
|
121
138
|
obj[key] = object[key];
|
|
122
139
|
return obj;
|
|
123
140
|
}, {});
|
|
124
|
-
}
|
|
141
|
+
}
|
|
125
142
|
|
|
126
143
|
/**
|
|
127
144
|
* Filters an object by its values
|
|
@@ -136,7 +153,7 @@ export abstract class mintObject {
|
|
|
136
153
|
}
|
|
137
154
|
return obj;
|
|
138
155
|
}, {});
|
|
139
|
-
}
|
|
156
|
+
}
|
|
140
157
|
|
|
141
158
|
/**
|
|
142
159
|
* Update two sets of objects
|
|
@@ -43,5 +43,14 @@ export abstract class mintText {
|
|
|
43
43
|
|
|
44
44
|
return word + 's';
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Capitalize the first letter of the given word
|
|
49
|
+
*/
|
|
50
|
+
static titleCase (text: string): string {
|
|
51
|
+
return text
|
|
52
|
+
.toLowerCase()
|
|
53
|
+
.replace(/(?:^|\s)\S/g, a => a.toUpperCase());
|
|
54
|
+
}
|
|
46
55
|
};
|
|
47
56
|
export default mintText;
|